The app takes a long time to run when it is first installed. It seems to be "hanging".
This is the state of the screen at that moment:
Then after a few seconds (10 or 15), it starts correctly.
When the app hangs on logcat
it, the following line is shown:
05-23 21:37:13.604 27661-27661/com.kirolm.kmibilbideaklezo W/System: ClassLoader referenced unknown path: /data/app/com.kirolm.kmibilbideaklezo-1/lib/arm
Then this is the logcat
complete: The labels, LogApp
and DatabaseHelper
they are mine to monitor the situation of the application.
05-23 21:37:28.835 27661-27661/com.kirolm.kmibilbideaklezo W/System: ClassLoader referenced unknown path: /data/app/com.kirolm.kmibilbideaklezo-1/lib/arm
05-23 21:37:28.939 27661-27661/com.kirolm.kmibilbideaklezo I/GMPM: App measurement is starting up, version: 8487
05-23 21:37:28.939 27661-27661/com.kirolm.kmibilbideaklezo I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
05-23 21:37:29.248 27661-27661/com.kirolm.kmibilbideaklezo W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
05-23 21:37:29.522 27661-27661/com.kirolm.kmibilbideaklezo I/LogApp: Main.java: Entrando en el onCreate de la app!
05-23 21:37:29.555 27661-27661/com.kirolm.kmibilbideaklezo I/DatabaseHelper: LoadDb.Async.java: Entra en PreExecute
05-23 21:37:29.600 27661-28432/com.kirolm.kmibilbideaklezo I/DatabaseHelper: LoadDb.Async.java: Entra en doInBackground
05-23 21:37:29.605 27661-28433/com.kirolm.kmibilbideaklezo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-23 21:37:29.625 27661-27661/com.kirolm.kmibilbideaklezo I/DatabaseHelper: LoadDb.Async.java: Entra en onProgressUpdate
05-23 21:37:29.647 27661-28432/com.kirolm.kmibilbideaklezo I/LogApp: DatabaseHelper. createDataBase. BD cargada.
05-23 21:37:29.684 27661-28433/com.kirolm.kmibilbideaklezo I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
05-23 21:37:29.689 27661-28433/com.kirolm.kmibilbideaklezo I/OpenGLRenderer: Initialized EGL, version 1.4
The problem is with the option
Instant Run
provided by Android Studio. If the app is disabled, it runs perfectly, so I deduce that once uploaded to Google Play there will be no problem.To disable
Instant Run
:Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run and uncheck
Enable Instant Run to hot swap code/resource changes on deploy (default enabled)
. I found the answer here:https://stackoverflow.com/questions/36623917/first-launch-take-long-time-in-android-studio-2-0-gradle-2-0
In any case, knowing that it is caused by the Android Studio IDE, you can continue with the option
Instant Run
enabled, since once it is published on Google Play, the app will run quickly.