Android Studio 2.0-App首次运行时暂停/白屏 [英] Android Studio 2.0 - pause/white screen on App first run

查看:121
本文介绍了Android Studio 2.0-App首次运行时暂停/白屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到Android Studio 2.0(稳定)以来,我注意到我安装的先前版本的Android Studio 1.5中没有这个问题.

Since upgrading to Android Studio 2.0 (stable) I've noticed an issue that wasn't there in the previous version of Android Studio 1.5 I had installed.

我正在开发一个当前项目,该项目将在真实设备和仿真器上进行构建(调试版本)并运行,我正在Android Studio 1.5中进行此操作.

I'm working on a current project, which I would build (debug version) and run, both on a real device, and an emulator, I was doing this in Android Studio 1.5.

自从升级Android Studio 2.0以来,每当我在同一项目/应用中进行构建(调试)并运行该项目/应用时,我都注意到我在设备或仿真器上出现了暂停.我在打开应用前几秒钟就出现了白屏,这在AS 1.5中是我以前所没有的,该应用会立即打开,没有暂停,也没有白屏-无论是否使用ADB插入电话,都会发生这种情况,或拔下电源.如果该应用仍在手机内存中,则它会立即打开,但是如果重新启动手机,则会出现暂停,并且在打开该应用时出现白屏.

Since upgrading Android Studio 2.0 whenever I make a build (debug) the same project/app and run it I have noticed that I get a pause on the device, or emulator. I get a white screen for a couple seconds before the app opens, which I didn't have before in AS 1.5, the app would open straight away, no pause, no white screen - this happens whether the phone is plugged in using ADB, or unplugged. If the App is still in phones memory it opens straight away, but if phone is restarted I get the pause, and white screen when the app is opened.

他们对此有解决方案吗?还有其他人经历过吗?我可能还为时过早,因为我还没有完成发布构建,但是这似乎是一个奇怪的问题-如果这是一个问题!

Is their a solution to this? Has anyone else experienced this? I may be a bit premature with this as I haven't done a release build yet, however this seems like a strange issue - if it is an issue!

我正在使用Instant Run,但是无论是否插入设备,都会发生这种情况.如果未将Instant Run插入,会对其执行产生影响吗?

I am using Instant Run, however this happens whether a device is plugged in or not. Would Instant Run make a difference to its execution if it wasn't plugged in?

更新:

如下所示,在Android Studio 2.0中关闭即时运行"选项可以解决此问题.但是,有趣的是,有评论表明,使用Instant Run APK时,其尺寸较小.这是什么意思?难道Instant Run使用较旧的Dalvik/JIT编译器而不是ART?这可以解释Apk大小的差异和滞后(Dalvik即时编译-JIT).此外,每次运行该应用程序时,ART都需要安装/编译,这意味着它的Apk大小会变大,并且执行速度会变慢.

As below answer turning off 'Instant Run' options in Android Studio 2.0 cures the problem. Interestingly however, comments suggest that when using Instant Run APK sizes are smaller. What does this mean? Could it be that Instant Run uses the older Dalvik/JIT compiler rather than ART? This could explain the Apk size difference, and the lag (Dalvik compiles on the fly - JIT). Also ART would need to install/compile each time the app was Run, meaning its Apk size would be larger, and slower to execute, as is the case.

希望有更多经验和知识的人也许能够确认或揭穿这件事.

Hopefully someone with more experience and knowledge maybe able to confirm or debunk this..

推荐答案

查看图像以供参考 在设置"中关闭即时运行". 文件>设置>构建,部署>即时运行 取消选择此处显示的所有选项.

Check image for reference Turn off Instant Run in Settings. File>Settings>Build,Deployment>Instant Run Deselect all options shown there.

现在白屏问题已经解决.

Now white screen problem is solved.

在android studio 2.0中,使用Instant Run时,我的APK大小为16 MB 在不使用Instant Run的情况下,它变为27 MB. 而在1.5 ..中,大小为27 MB.

In android studio 2.0,My APK size was 16 MB while using Instant Run Without using Instant Run it became 27 MB. While in 1.5 .. the size was 27 MB.

立即逃跑是元凶.

  • 白屏问题/即时运行仅适用于Debug版本.问题不会影响发行版本.

这篇关于Android Studio 2.0-App首次运行时暂停/白屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆