9

My application taking so much time to launching First Activity screen. It will showing white screen for long time. Even after kill my application and accessing.

I am using Java 8 and Android Studio 2.1.1, Gradle version as com.android.tools.build:gradle:2.1.0

Naveen Kumar M
  • 7,497
  • 7
  • 60
  • 74

8 Answers8

8

The Instant Run is enabled in your Android Studio. Try to disable the function. You will not get that issue.

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

Community
  • 1
  • 1
Panneer Selvam R
  • 443
  • 3
  • 11
8

check this In android studio --> File --> Setting --> Build --> Remove tick following option's enter image description here

Milan Pansuriya
  • 2,521
  • 1
  • 19
  • 33
4

if you are launching application to the first time it take time to load, after that when you open it second time it not take time to open.

You are using debug_apk. try creating release sign apk once and check it take time or not.

Krunal Dave
  • 113
  • 8
  • You are using debug_apk. try creating release sign apk once and check it take time or not. --- Can u explain this why need to check with release apk? – Daxesh V May 29 '20 at 16:02
  • @DaxeshVekariya, I guess what Dave mentioned is minify enabled build. (debug built apk is also signed with debug keystone) – Tuan Chau Jul 21 '20 at 03:02
2

If you have an image which shows in splash screen and if there is only single density image, put it in drawable-xxxhdpi folder.

Shubham Gupta
  • 93
  • 1
  • 4
1

In my experience, Fabric consumes a bit of time in establishing the connection and communicating.

I would suggest you to comment the Fabric portion on the code and re-run to see if there is any change in the app load time.

Additionally u could move the code on to an async task rather than performing these on the main thread. It would at least not slow down ur initial app launch time.

1

If someone is still facing this issue, please check your styles.xml for the below entry, and disable it, if it is present.

<item name="android:windowDisablePreview">true</item>
prashant
  • 199
  • 2
  • 7
0

In my case, it was due to instant run enabled. Though this works fine on the latest android version 4.1.1

0

check above answer https://stackoverflow....

<item name="android:windowDisablePreview">true</item>

after removing above line from style.xml , it worked fine for me

I tried finding instant run option but not found in Chipmunk version of android studio.