Question

I currently found out, that my Application developed for Android 1.6 does not work on Android 2.2. I'm quite puzzled about this, because its a very simple Application which almost does nothing.

The Expeption I get is like that:

java.lang.RuntimeException: Unable to instantiate application [packagename].AndApp:
java.lang.ClassNotFoundException: [packagename].AndApp in loader
dalvik.system.PathClassLoader[/data/app-private/[packagename]-1.apk]

The weirdest part is, that the Class it is searching for here does not exist and never has...

The app itself does nothing than show some text in a textview.

In Android 1.6 I dont get this problem and I cant see a reason, it event works in 2.1.

Has anybody a clue what this problem might be?

The Manifest looks like that:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="[packagename]" android:versionName="1.02" android:versionCode="3">
    <application android:label="@string/app_name" android:icon="@drawable/stop_48"
        android:description="@string/Description" android:name="@string/app_name">
        <activity android:name=".DefaultActivity" android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"</uses-sdk>
</manifest> 
Was it helpful?

Solution

The problem is in your manifest file. You have not closed the tag. Please add before to close the tag. Then, you will not need the empty class.

OTHER TIPS

after another day struggling with this problem and trying out alot of weird stuff, I came up with the Idea of just simply creating this class it was searching for.

At first it didnt work either, but then I derived this empty class of Application and this seemed to be the solution.

I'm not shure why and I dont know what caused this problem: maybe its a bug in the plugin for Eclipse?

I'm still not satisfied with this result: I would really like to know whats going on here!

If anybody has an explanation for that, pls post.

I have the same problem. I've fixed as you said.

I've create the class:

public class AndApp extends Application{}

And now it works but i don't know why

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top