Domanda

help me to resolve this getting this exception

java.lang.RuntimeException: Unable to instantiate application delhi.roshanara.margapp.MargApp: java.lang.ClassNotFoundException: delhi.roshanara.margapp.MargApp in loader dalvik.system.PathClassLoader[/data/app/delhi.roshanara.margapp-2.apk]

It is searching MargApp Activity to open the project but there is no activity of this name. And I want to start my activity as .LoginActivity. Manifest file structure is given below:-

<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:name="MargApp" >
        <activity
            android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".OrderMenuPage" />
        <activity
            android:name=".PartyOutstanding" />
        <activity
            android:name=".PartyPDC" />
        <activity 
            android:name=".TakeOrder"></activity>

         <activity
            android:name=".ShowOutstanding"
            android:screenOrientation="landscape" />
        <activity 
            android:name=".ShowPDC"
            android:screenOrientation="landscape"></activity>

    </application>
È stato utile?

Soluzione

I would try removing

android:name="MargApp" 

if that didn't work try Cleaning up your project

Project>Clean

Altri suggerimenti

Do not use the android:name attribute! It, misleadingly, does not have anything to do with the name of your app and is actually the name of an extra class to load before loading your application. That's why you are getting the ClassNotFoundException. Remove it and it should work:

Replace your application tag with this one...

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top