java.lang.RuntimeException的:无法实例化应用android.app.Application:显示java.lang.NullPointerException在LoadedApk.makeApplication [英] java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException at LoadedApk.makeApplication

查看:1681
本文介绍了java.lang.RuntimeException的:无法实例化应用android.app.Application:显示java.lang.NullPointerException在LoadedApk.makeApplication的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我得到这个错误不时。这是在应用程序从Eclipse运行按钮启动。发生这种情况时连用4-5次。 任何人有一个想法,这是怎么回事。

我真的AP preciate了!

  05-01 18:08:31.109:W / dalvikvm(15491):主题ID = 1:螺纹退出与未捕获的异常(组= 0x40a311f8)
05-01 18:08:31.109:E / AndroidRuntime(15491):致命异常:主要
05-01 18:08:31.109:E / AndroidRuntime(15491):java.lang.RuntimeException的:无法实例化应用android.app.Application:显示java.lang.NullPointerException
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.LoadedApk.makeApplication(LoadedApk.java:482)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.ActivityThread.access $ 1300(ActivityThread.java:123)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1185)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.os.Handler.dispatchMessage(Handler.java:99)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.os.Looper.loop(Looper.java:137)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.ActivityThread.main(ActivityThread.java:4424)
05-01 18:08:31.109:E / AndroidRuntime(15491):在java.lang.reflect.Method.invokeNative(本机方法)
05-01 18:08:31.109:E / AndroidRuntime(15491):在java.lang.reflect.Method.invoke(Method.java:511)
05-01 18:08:31.109:E / AndroidRuntime(15491):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:784)
05-01 18:08:31.109:E / AndroidRuntime(15491):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-01 18:08:31.109:E / AndroidRuntime(15491):在dalvik.system.NativeStart.main(本机方法)
05-01 18:08:31.109:E / AndroidRuntime(15491):由:显示java.lang.NullPointerException
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
05-01 18:08:31.109:E / AndroidRuntime(15491):在android.app.LoadedApk.makeApplication(LoadedApk.java:474)
05-01 18:08:31.109:E / AndroidRuntime(15491):11 ...更多
 

解决方案

看着到ICS源$ C ​​$ C - 这似乎是出于某种原因,包管理器不能得到你的包的信息 - 这可能仅仅是一个Eclipse / ADT错误的地方日食持有某种类型的文件锁定,但不管它是什么,它​​似乎并不喜欢的东西,你可能会与你的code。我建议运行一个干净,从模拟器/设备卸载应用程序,或者如果这些不工作,你可以尝试一个新的Eclipse工作区。

这可能是一个问题的另一件事是,如果您使用的是库项目 - 尝试取消链接二,清洗,然后把它们连接再次备份 - 但多数民众赞成我的提包O'招数:)

更新: yorkw给出了为什么出现这种情况,并在此其第一个更好的解释:<一href="http://stackoverflow.com/questions/10150899/runtimeexception-unable-to-instantiate-application/10158241#10158241">RuntimeException:无法实例化应用

So I get this error from time to time. It's at the application launching from the Run button in Eclipse. this occurs once every 4-5 times. Anyone has an idea what's going on.

I really appreciate it!

05-01 18:08:31.109: W/dalvikvm(15491): threadid=1: thread exiting with uncaught exception (group=0x40a311f8)
05-01 18:08:31.109: E/AndroidRuntime(15491): FATAL EXCEPTION: main
05-01 18:08:31.109: E/AndroidRuntime(15491): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.ActivityThread.access$1300(ActivityThread.java:123)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.os.Looper.loop(Looper.java:137)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.ActivityThread.main(ActivityThread.java:4424)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at java.lang.reflect.Method.invokeNative(Native Method)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at java.lang.reflect.Method.invoke(Method.java:511)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at dalvik.system.NativeStart.main(Native Method)
05-01 18:08:31.109: E/AndroidRuntime(15491): Caused by: java.lang.NullPointerException
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
05-01 18:08:31.109: E/AndroidRuntime(15491):    at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
05-01 18:08:31.109: E/AndroidRuntime(15491):    ... 11 more

解决方案

Looked into the ICS source code - It seems like for whatever reason the Package Manager can't get your package info - it could just be an eclipse/ADT bug where eclipse holds some kind of lock on the file, but whatever it is, it doesn't seem like something that you could cause with your code. I would suggest running a clean, uninstalling the app from the emulator/device, or if those don't work, you might try a fresh eclipse workspace.

Another thing that might be an issue is if you're using a Library project - try unlinking the two, cleaning, and then linking them back up again - but thats it for my bag o' tricks :)

UPDATE: yorkw gives a better explanation for why this occurs and its resolution here: RuntimeException: Unable to instantiate application

这篇关于java.lang.RuntimeException的:无法实例化应用android.app.Application:显示java.lang.NullPointerException在LoadedApk.makeApplication的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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