0

I am running a debug android application with eclipse and the simulator, and on a restarting of the app, I get this exception,

03-23 02:19:51.384: E/AndroidRuntime(605): FATAL EXCEPTION: main
03-23 02:19:51.384: E/AndroidRuntime(605): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.ActivityThread.access$1300(ActivityThread.java:123)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.os.Looper.loop(Looper.java:137)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.ActivityThread.main(ActivityThread.java:4424)
03-23 02:19:51.384: E/AndroidRuntime(605):  at java.lang.reflect.Method.invokeNative(Native Method)
03-23 02:19:51.384: E/AndroidRuntime(605):  at java.lang.reflect.Method.invoke(Method.java:511)
03-23 02:19:51.384: E/AndroidRuntime(605):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-23 02:19:51.384: E/AndroidRuntime(605):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-23 02:19:51.384: E/AndroidRuntime(605):  at dalvik.system.NativeStart.main(Native Method)
03-23 02:19:51.384: E/AndroidRuntime(605): Caused by: java.lang.NullPointerException
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
03-23 02:19:51.384: E/AndroidRuntime(605):  at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
03-23 02:19:51.384: E/AndroidRuntime(605):  ... 11 more

But this doesn't really say where the error happened in my code. Any idea why this might be happening and how to prevent it?

and this is the entire manifest of the small application:

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

    <uses-sdk android:minSdkVersion="15" />

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".ProblemioActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".AddProblemActivity"
            android:label="@string/add_problem" />

        <activity
            android:name=".LoginActivity"
            android:label="@string/login" />        

        <activity
            android:name=".MyProblemsActivity"
            android:label="@string/your_problems" /> 

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

        <activity
            android:name=".CreateProfileActivity"
            android:label="@string/create_account" />         

        <activity
            android:name=".ProblemActivity"
            android:label="@string/problem_page_header" />   

        <activity
            android:name=".SuggestSolutionActivity"
            android:label="@string/suggest_solution_header" />  

        <activity
            android:name=".SuggestedSolutionActivity"
            android:label="@string/suggested_solution_header" />          

        <activity
            android:name=".ViewSolutionsActivity"
            android:label="@string/view_solutions_header" />        

        <activity
            android:name=".TopicActivity"
            android:label="@string/topic_header" /> 

    </application>

</manifest>

Thanks!

5
  • Do you have any Application on your solution? Did you declared the name on the Manifest? Commented Mar 23, 2012 at 2:27
  • @Tiago There is actually a whole app that works despite this message....I'll also post the manifest. Commented Mar 23, 2012 at 2:31
  • See stackoverflow.com/questions/9039017/…. In that case cleaning the project fixed the prob..for whatever reason. Maybe this will help you too Commented Mar 23, 2012 at 2:57
  • @207 I thought cleaning the project was getting rid of errors. But in the solution's case, was it just a matter of adding this at the end of every inner class? EditEntry.this.finish(); Commented Mar 23, 2012 at 3:09
  • @GeekedOut Yes. See the comments of that answer. Someone reproduced the problem and fixed it by cleaning. That NullPointer from LoadedApk.initializeJavaContextClassLoader seems to be quite popular Commented Mar 23, 2012 at 3:17

2 Answers 2

1

I also get this excepiton. I am using Nexus S, and update to 4.0.3 I just ignore this exception.

Sign up to request clarification or add additional context in comments.

1 Comment

I used to ignore it, but now I tried to release the app live and I am getting some errors while adding a key to the apk file and someone suggested I should clean out application errors so thats why I am cleaning it from the error.
0

The real solution to this problem is a folder permissions issue. Make sure you are operating in a folder that you can modify. I just fixed that same problem for my self by making sure I was in a folder with the right permissions.

1 Comment

What folder are you talking about?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.