简体   繁体   中英

Caused by: java.lang.IllegalStateException: package not installed?

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM