I have been testing a release build on a chromebook and I have noticed that if the device is not connected to an adb server the app will take a long time to launch (10+ seconds), showing a screen with the icon and “starting ”. When the device is connected by ADB, there is no long pause like this. Seeing as the problem only arises when it is not connected, I have found Logcat unhelpful in finding a solution.
I should note that I have tried many oprimization methods, which have had no impact on this loading screen, which is occuring before the splash screen.
What could be causing this and is there a way to reduce this start time without having the device connected via ADB all the time?
Sure enough, I have the same issue with earlier versions.
I have been profiling the build apk with Android Studio and noticed that in the merged manifest of all the build it declares: android:debuggable=“true”’.
I have tried making custom manifests and adding the following code:
but regardless of where I write this, every build I profile keeps showing debuggable as true. I have tried exporting my project to android studio but when I look at that projects merged manifest no such declaration is present. This makes me think that the building process makes the apk debuggable.
Is there anyway to prevent this from happening? Maybe more importantly, is this even relevant to my issue?
I have been making sure it is a relases build. I managed to change the build variant to release and made a build without debuggable. This build still had the same slow launch.
I have noticed that this slow start is only true the first time the app is launched on the device without an adb connected. If I close and relaunch the app it goes to the splash screen very quickly.
Is there anything else that could be the cause of this slow start?