KBusc
KBusc

Reputation: 663

App Throws Fatal Error, then reboots and works

I am developing an app that has been working for sometime now. Recently I have gotten an error message not upon opening the app but only on the first Install. The log cat shows a fatal error (NPE) then the app reboots itself and all is fine. But I am concerned that there is something happening that I need to worry about. the Log cat is as follows

07-30 08:09:01.060: W/dalvikvm(6469): threadid=1: thread exiting with uncaught          exception (group=0x4136e2a0)
07-30 08:09:01.060: E/AndroidRuntime(6469): FATAL EXCEPTION: main
07-30 08:09:01.060: E/AndroidRuntime(6469): java.lang.RuntimeException: Unable to    instantiate application android.app.Application: java.lang.NullPointerException
07-30 08:09:01.060: E/AndroidRuntime(6469):     at        android.app.LoadedApk.makeApplication(LoadedApk.java:501)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4198)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at  android.app.ActivityThread.access$1300(ActivityThread.java:140)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1288)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at    android.os.Looper.loop(Looper.java:137)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.ActivityThread.main(ActivityThread.java:4895)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at java.lang.reflect.Method.invokeNative(Native Method)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at java.lang.reflect.Method.invoke(Method.java:511)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at dalvik.system.NativeStart.main(Native Method)
07-30 08:09:01.060: E/AndroidRuntime(6469): Caused by: java.lang.NullPointerException
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
07-30 08:09:01.060: E/AndroidRuntime(6469):     at android.app.LoadedApk.makeApplication(LoadedApk.java:493)
07-30 08:09:01.060: E/AndroidRuntime(6469):     ... 11 more
07-30 08:09:09.709: E/SensorManager(6554): thread start

And the Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rte"
android:versionCode="1"
android:versionName="1.0" >

<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/rcr6"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" android:logo="@drawable/rcr6">
    <activity
        android:name="com.rte.MainActivity"
        android:label="@string/app_name" 
        android:configChanges="orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>      
    <activity
        android:name="com.rte.SettingsActivity"
        android:label="@string/title_activity_settings" >
    </activity>
    <activity
        android:name="com.rte.About"
        android:label="@string/title_activity_about" >
    </activity>
</application>

Any help is greatly appreciated.

Upvotes: 0

Views: 237

Answers (1)

KBusc
KBusc

Reputation: 663

For anyone reading this that may have a similar problem the answer can be found here

RuntimeException: Unable to instantiate application

and if that is not quite what you're looking for try here

Exception when I run my application from Eclipse

Upvotes: 1

Related Questions