引起:java.lang.IllegalStateException:包没有安装?

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 

我在logcat中遇到这种错误。 虽然我得到这个错误我的项目运行好。所以我只是想澄清这些事情有关此错误:

 1.what causes this error? 2.what may happened if the error persist? 3.how to fix this error? 

Solutions Collecting From Web of "引起:java.lang.IllegalStateException:包没有安装?"

我认为这发生在你已经安装了以前的版本时从eclipse运行应用程序? 如果您在从eclipse运行之前卸载应用程序,则不会发生这种情况。 另外,这不会造成任何问题。

尝试在build.gradle文件中使用较旧的Gradle依赖关系版本。 它帮助了我。

使用:

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

不要使用:

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

我在这里find解决scheme – Android Studio FloatingActionButton错误

min sdk版本和target sdk版本应该是一样的..