“未安装软件包吗?"项目的例外具有不同的构建变体 [英] "is package not installed?" exception for project have different build variants

查看:85
本文介绍了“未安装软件包吗?"项目的例外具有不同的构建变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题.当项目运行时,我很少会遇到致命的异常. 我在同一项目中有两个不同的Android应用程序,用于不同的构建变体.但是它们的软件包名称是不同的. 在清单文件中,写入了我的第一个应用程序的程序包名称.当我运行第二个项目时,我很少会遇到致命的异常.

I have a question. When project is run, I rarely get fatal exception. I have two different android applications in the same project for different build variants. But their package name are different. In manifest file, my first application's package name is written. I rarely get fatal exception, when I run my second project.

如何解决此错误?

06-15 10:58:19.104 2322-2322/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process:  com.xxx.yyy.zzz, PID: 2322
                                                 java.lang.RuntimeException:Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for >com.xxx.yyy.zzz; is package not installed?
                                                     at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
                                                     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4526)
                                                     at android.app.ActivityThread.access$1500(ActivityThread.java:151)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:135)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at java.lang.reflect.Method.invoke(Method.java:372)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                  Caused by: java.lang.IllegalStateException: Unable to get package info for com.xxx.yyy.zzz; is package not installed?
                                                     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:409)
                                                     at android.app.LoadedApk.makeApplication(LoadedApk.java:555)
                                                     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4526) 
                                                     at android.app.ActivityThread.access$1500(ActivityThread.java:151) 
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                     at android.os.Looper.loop(Looper.java:135) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at java.lang.reflect.Method.invoke(Method.java:372) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

推荐答案

您应该控制自己的体系结构,在其他任何地方控制您的构建变体,或者使您的项目具有任何将构建变体作为静态字符串的xml文件.

You should control your architecture, does anywhere else control your build variants or have your project any xml file regarding build-variants as static string.

这篇关于“未安装软件包吗?"项目的例外具有不同的构建变体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆