Sultan Ahmed
Sultan Ahmed

Reputation: 2220

RuntimeExceptionjava.lang.RuntimeException: Unable to instantiate activity ComponentInfo

I have declared LoginActivty in menifest.xml . The following is the menifest.xml of my android project .

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

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

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >

        <activity
        android:name="LoginActivity"
        android:label="@string/app_name" 
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

<activity android:name="MainActivity"/> 

    </application>

</manifest>

My Activity is stored like this :

enter image description here

But I am getting this exception :

03-07 13:18:29.118: E/ActivityThread(30283): RuntimeExceptionjava.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.sdc.android.milestone/com.sdc.android.milestone.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "com.sdc.android.milestone.LoginActivity" on path: DexPathList[[zip file "/mnt/asec/com.sdc.android.milestone-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.sdc.android.milestone-1/lib, /vendor/lib, /system/lib]]

Build Path :

enter image description here

enter image description here

Why am I getting this exception ? Please help me .

Upvotes: 0

Views: 200

Answers (2)

AAA
AAA

Reputation: 505

please follow this. https://developers.google.com/identity/sign-in/android/sign-in

you made mistake adding google sign in button

Upvotes: 0

user6490462
user6490462

Reputation:

You can't set two main activity as below:

<action android:name="android.intent.action.MAIN" />

this is wrong..

your Mainfist.xml should be like:

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" 
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

<activity android:name="LoginActivity"/>

Upvotes: 3

Related Questions