android启动时报错Unable to instantiate application xxxx:java.lang.NullPointerException

如果程序已经运行,再安装到手机的时候总是报以下错误。而且是在打开特定的Activity的情况下才会报错。

06-26 09:45:16.971: E/AndroidRuntime(29733): java.lang.RuntimeException: Unable to instantiate application com.css.promotiontool.ui.CSSAppliction: java.lang.NullPointerException
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4245)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.ActivityThread.access$1400(ActivityThread.java:131)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1288)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.os.Looper.loop(Looper.java:137)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.ActivityThread.main(ActivityThread.java:4866)
06-26 09:45:16.971: E/AndroidRuntime(29733): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 09:45:16.971: E/AndroidRuntime(29733): at java.lang.reflect.Method.invoke(Method.java:511)
06-26 09:45:16.971: E/AndroidRuntime(29733): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
06-26 09:45:16.971: E/AndroidRuntime(29733): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
06-26 09:45:16.971: E/AndroidRuntime(29733): at dalvik.system.NativeStart.main(Native Method)
06-26 09:45:16.971: E/AndroidRuntime(29733): Caused by: java.lang.NullPointerException
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:384)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.LoadedApk.getClassLoader(LoadedApk.java:327)
06-26 09:45:16.971: E/AndroidRuntime(29733): at android.app.LoadedApk.makeApplication(LoadedApk.java:500)
06-26 09:45:16.971: E/AndroidRuntime(29733): ... 11 more

这个问题困扰了好久,网上也查了好多次,但是都没有解决问题。最后从引用资源文件入手,发现是特定的activity标签下引用了资源文件:

<activity
android:name=xxxx
android:label="@string/app_name"/>

删掉引用资源文件就可以了,由于时间问题具体原因未深究。

android启动时报错Unable to instantiate application xxxx:java.lang.NullPointerException,布布扣,bubuko.com

时间: 2024-10-25 09:22:03

android启动时报错Unable to instantiate application xxxx:java.lang.NullPointerException的相关文章

hbase报错org.apache.hadoop.ipc.RemoteException(java.lang.NullPointerException): java.lang.NullPointerException

这个错误找了好长时间,日志看半天,找度娘没什么用,再看stackoverflow,上面有几篇相关的帖子,但是没人回答. 看半天,没有cause,只好到idea中去看sortLocalSorts源码,结果才知道是dns解析相关的配置,查了几个主机上的hbase-site.xml没问题,HA配置也没问题,最后才知道是s201机架感知忘了配,就是这个:net.topology.node.switch.mapping.impl 具体怎么配置机架感知自己去搜博客哈,本人前几篇有关于机架感知的博客,怎么配置

Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误的集中原因及解决办法

上面那个问题刚解决,就又来一个问题~~~~ 错误信息字符串:java.lang.RuntimeException: Unable to start activity ComponentInfo{...}: java.lang.NullPointerException 网上有不少解决办法 一般都会在Activity  onCreate()方法里的setContentView(XXX)发生此错误,网上查阅了很多原因,大概有四种重要可能的原因: 原因一:xxx的错误,若为R.layout.main 

Android - 错误:Unable to instantiate application

错误:Unable to instantiate application 本文地址: http://blog.csdn.net/caroline_wendy 错误:java.lang.RuntimeException: Unable to instantiate application me.chunyu.paddoctor.Activity Java执行时异常,不能实例化应用:XXX. 原因: <application>的"android:name"属性错误.即andro

Reporting Service 服务启动时报错The service did not respond to the start or control request in a timely fashion

案例环境: 启动一台数据库服务器(Windows Server 2003)的Reporting Service(SQL Server 2008 R2)服务时,出现如下错误信息: System.InvalidOperationException: Cannot start service ReportServer on computer 'xxx'. ---> System.ComponentModel.Win32Exception: The service did not respond to

SQL Developer 4.0 启动报错“unable to create an instance of the java virtual machine located at path”

安装了Oracle之后,第一件事情就是想想怎么去连接,进而操作.SQL Developer是官方提供的强大工具,个人看来也是第一选择. 目前官网提供的最新版是4.0.1.14.48,下载下来之后,就跃跃欲试了.将下载下来的包解压,直接运行sqldeveloper.exe这个文件,选择了本地安装的JDK路径,之后却不幸的报错了,提示"unable to create an instance of the java virtual machine located at path",具体界面

开发错误记录8:Unable?to?instantiate?application?com

开发错误记录8:Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication 这是因为在Android Studio2 新的即时运行功能 导致的,因为,这个功能只在更改布局文件时不用重新编译! 把这个功能关闭即可! 在Android 6.0的新增了权限管理机制,所以在调用相应的权限,要重新申请,在6.0以下的版本,不存在,否则在操作相机,联系人,打电话等,会报如下的错误 :(网上有很多封装好

新安装的soapui启动时报错及解决方法

今天新安装了soapui准备测试一下接口,结果安装成功后启动时报错:The JVM could not be started. The maximum heap size (-Xmx) might be too large 意思就是:Java虚拟机无法启动.Xmx可能太大 这时就需要将这个参数的值改小一点. 经过排查这个参数在soapui安装目录\bin\目录下的vmoptions配置文件中 将原来的值改为800,保存后启动成功

Eclipse启动时报错

Eclipse启动时报错:A Java RunTime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No java virtual machine was found after searching the following locations:- 此问题起于我在Ubuntu装了两个版本的eclipse:java8和java7:卸载前者后出现启动不了ecli

Android 运行时报错Error running app: Instant Run requires &#39;Tools | Android | Enable ADB integration&#39; to be enabled. 的解决办法

解决方法:在菜单栏,Tools->Android->Enable ADB integration勾选就可以了. Android 运行时报错Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled. 的解决办法