Error type 3: Activity Class {…} does not exist

2019-01-06 19:10发布

AndroidManifest:

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

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

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

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
    <activity
            android:name="com.m.e"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action
                    android:name="android.intent.action.MAIN"
                    />

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity
            android:name="com.m.e"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="orientation|keyboardHidden">
        <intent-filter>
            <action
                    android:name="android.intent.action.first"
                   />

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

    .....

</application>

</manifest>

Error :

 Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.m.e/.Splash }
 Error type 3
 Error: Activity class {com.m.e/com.m.e.Splash} does not exist.

Note: .Splash does exist.

22条回答
Lonely孤独者°
2楼-- · 2019-01-06 19:28

Mostly it's an eclipse issue, so the normal scenarios might work with you. Clean the project and rebuild the work space, open the manifest and check if there is any error, recheck the class name mentioned in the log, clean again and again, restart eclipse , open and clean.

查看更多
啃猪蹄的小仙女
3楼-- · 2019-01-06 19:30

I had the same error after renaming/refactoring. What I did was add the applicationId property attribute to my build.gradle file, and set its value to the application package. Like this:

android{
    defaultConfig{
        applicationId "com.example.mypackage"
    }
}
查看更多
做个烂人
4楼-- · 2019-01-06 19:33

I resolved this issue by restarting my test device and restarting Android Studio.

查看更多
Lonely孤独者°
5楼-- · 2019-01-06 19:34

I suppose you have a devices like my LG Stylus 3 Android 7.0, in which when you press and move app from desktop to the trash, app does not removed from device. See my accepted answer on the same question for details.

查看更多
Summer. ? 凉城
6楼-- · 2019-01-06 19:34

I was using a library module with an example Activity that was specified in the Manifest.

taking out the example activity from the manifest in the library project worked for me.

查看更多
虎瘦雄心在
7楼-- · 2019-01-06 19:34

This is how i fixed it. go to gradle > Tasks > Install > UninstallAll

enter image description here

查看更多
登录 后发表回答