21
06-26 05:07:17.890: E/AndroidRuntime(3231): FATAL EXCEPTION: main
06-26 05:07:17.890: E/AndroidRuntime(3231): Process: com.sample.calendar, PID: 3231
06-26 05:07:17.890: E/AndroidRuntime(3231): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.sample.calendar; is package not installed?
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4317)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.os.Handler.dispatchMessage(Handler.java:102)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.os.Looper.loop(Looper.java:136)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.ActivityThread.main(ActivityThread.java:5017)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at java.lang.reflect.Method.invokeNative(Native Method)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at java.lang.reflect.Method.invoke(Method.java:515)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at dalvik.system.NativeStart.main(Native Method)
06-26 05:07:17.890: E/AndroidRuntime(3231): Caused by: java.lang.IllegalStateException: Unable to get package info for com.sample.calendar; is package not installed?
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:376)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:329)
06-26 05:07:17.890: E/AndroidRuntime(3231):     at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
06-26 05:07:17.890: E/AndroidRuntime(3231):     ... 11 more

I'm getting this kind of error in my logcat. Although I'm getting this error my project runs ok.So i just want to clarify these things regarding this error:

1.what causes this error?

2.what may happened if the error persist?

3.how to fix this error?
Giant
  • 1,619
  • 7
  • 33
  • 67
  • whats your application package name?? – Pragnesh Ghoda シ Jun 26 '14 at 09:15
  • com.sample.calendar this is my package..i have the correct package and the emulator runs my project so i dont understand why im getting the error – Giant Jun 26 '14 at 09:16
  • 1
    pls check if you have specified the same package name in menifest file – Pratap Singh Jun 26 '14 at 09:19
  • 1
    delete the old apk (if any) from your device and then try running this project. – TheLostMind Jun 26 '14 at 09:24
  • possible duplicate of [Unable to instantiate application, Unable to get package info, Package not installed?](http://stackoverflow.com/questions/22613829/unable-to-instantiate-application-unable-to-get-package-info-package-not-insta) – Sam Jul 08 '15 at 10:43

2 Answers2

15

I think this happens when you run the app from eclipse while you already have the previous version installed ? This won't happen if you uninstall the app before running it again from eclipse. Also, this won't cause any problems.

Shivam Verma
  • 7,973
  • 3
  • 26
  • 34
  • i see i will try uninstalling the app and be back on you..im just worried if it will affect the performance of my app because i see a lot of 06-26 05:06:24.280: I/Choreographer(3193): Skipped 115 frames! The application may be doing too much work on its main thread. this line in my logcat..doing too much work thing – Giant Jun 26 '14 at 09:23
  • You also might want to do any time taking tasks such as network connection, database transactions, file transactions off the ui thread. – Shivam Verma Jun 26 '14 at 09:26
  • im sorry i dont understanding you..what do you mean by "do any time taking tasks such as network connection, database transactions, file transactions off the ui thread"? – Giant Jun 26 '14 at 09:29
  • 1
    in case you are doing any of the above mentioned tasks, do them on a background thread so that the ui is not blocked. – Shivam Verma Jun 26 '14 at 09:30
  • in connecting to database i am using databasehelper what i have there is a listview that is populated from the database..i read the link you showed and im studying it now.. – Giant Jun 26 '14 at 09:33
  • 1
    So this reading from the database will take some time, minimal but it will and skipping frames could be caused by this. If you move the reading from database to a background thread, your problem of frames being skipped will mostly be solved :) – Shivam Verma Jun 26 '14 at 09:35
  • 1
    yep. You can fetch database values in doInBackground(). – Shivam Verma Jun 26 '14 at 09:39
  • This problem causes a crash dialog to appear to the user when the app upgrades, so I think it is a bit of a problem. – Sam Jul 08 '15 at 10:44
  • Upgrading how ? Via the play store ? – Shivam Verma Jul 10 '15 at 03:45
  • Does this error appear in Crashlytics every time the project is compiled? – Pablo Alfonso Feb 25 '20 at 21:06
1

Try using older gradle dependencies version in you build.gradle file. It helped me.

Use:

compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'

Don't use:

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'

I find solution here - Android Studio FloatingActionButton error

Community
  • 1
  • 1
Mikhail
  • 2,612
  • 3
  • 22
  • 37