Why does my App start incredibly slow (10s+) at first run, showing only white screen on android 5.0?

后端 未结 2 803
死守一世寂寞
死守一世寂寞 2020-12-14 11:35

I have a freshly created app (built in android studio 2.0), having a few activities.

When I test it on my Android 4.3 (note 2) device it starts nicely and fast after

相关标签:
2条回答
  • 2020-12-14 12:18

    This is because of InstantRun feature, it only occurs with debug-builds.

    If you want to stop using InstantRun go to Settings>Build,Execution,Development>InstantRun and then uncheck all and apply.

    0 讨论(0)
  • 2020-12-14 12:28

    This is because Instant Run takes awhile to load. The blank/white screen will go away in production builds.

    I'm not sure why Instant Run takes so long to load. If you look in the app's internal cache directory you will see quite a few dex files. There was an article about how Instant Run works posted a couple days ago here: https://medium.com/google-developers/instant-run-how-does-it-work-294a1633367f#.ntl30mbe2

    You can disable Instant Run or just be aware that your production builds will not have this blank white screen.

    Similar question: Android Studio 2.0 - pause/white screen on App first run

    0 讨论(0)
提交回复
热议问题