Android APP takes too long to open on device for first time
The app im developing works with no problem on emulator, but when i installed, the debug apk on a device, it takes 30 secs or maybe a minute to open the first time (white screen for the entire time), and when finally it shows something and the app runs, it first shows me an error that the app takes too long, i choose to ignore it since the app finally show something. When it finally works for the first time, it runs with no prolem at all. This only happened THE FIRST TIME the app is opened after installation. So in summary: 1. The app works great on emulator. 2. The app is installed with no problem 3. The first time the app is opened it show nothing but a full white screen 4. The app finally works just like in the emulator 5. Shortly after the app start working, the device show me an error, to close or wait for the app. 6. After ignoring the error, the app works with no problem at all, all services working. 7. If the app is closed and opened again works perfectly
Note: This app have multiDexEnabled true, i know this may be the cause, but in the emulator works fine.
Thanks for all the help you can give me here.
In your situation I would try following things:
- If the application was previously installed and not getting installed again, then from the command prompt run “adb uninstall” package name
- On the phone Settings -> Application -> Development -> Debuggable to true
Try installing the app from the command prompt
adb install apk.file
- Restart the device: It has happened with me also, restarting the phone & eclipse solved my problem.
Hope it helps!