Reputation: 47
I am working on a school project to create basic android apps. It runs very well before I added few classes (I copy-paste them from my previous classes, it has the same logic/structure but different XML)
When I tried to run my 'updated' app, logCat always show this error:
05-07 09:19:15.402: E/AndroidRuntime(1370): FATAL EXCEPTION: main
05-07 09:19:15.402: E/AndroidRuntime(1370): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.anatomi; is package not installed?
05-07 09:19:15.402: E/AndroidRuntime(1370): at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
and then, on the emulator, the "unfortunately, application has stopped" message appears. However after I pressed OK, it's not even crashing and the app runs as normal.
Am I missing something? I'm pretty sure that the .java and .xml have the right structure, and the manifest too.
Upvotes: 1
Views: 1042
Reputation: 100438
This happens sometimes when pushing a new version of your app to the device or emulator, when the old version is swapped with the new version. During that time, the package is not available, and this 'crash' occurs.
This is nothing to worry about, as this scenario will not occur in 'real life' (assuming Play Store updates are handled more gracefully, as I've never seen these crashes there).
Upvotes: 2