简体   繁体   中英

Activity class {} does not not exist android 3.5.1(Instant run is no longer available)

I am trying to create application but while debugging after several time I am getting error. Error: Activity class {com.tectibet.loginapp/com.tectibet.loginapp.MainActivity} does not exist.I tried cleaning cache and restart,rebuild and clean.

I have tried changing manifest and build.gradle package name as well. also I went through Error type 3 Error: Activity class {} does not exist but it didt work out.

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".HomeActivity"></activity>
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

Application is not launching at all displaying error like activity is does not exist(even though i does).

Error while executing: am start -n "com.tectibet.loginapp/com.tectibet.loginapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tectibet.loginapp/.MainActivity } Error type 3 Error: Activity class {com.tectibet.loginapp/com.tectibet.loginapp.MainActivity} does not exist.

Option 1:

In build.gradle , the line:

apply plugin: 'android-library'

needs changed to:

apply plugin: 'com.android.application'

Option 2:

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

在此处输入图像描述

Faced this problem in android studio 3.5.1 Took me a day to solve this problem,Tried everything including cleaning cache,restart and renaming package name as well. So if any of above did't work than try this first. Error type 3 Error: Activity class {} does not exist
If it did't work than try this method.

Just go to gradle > Tasks > Install > UninstallAll

Here is the link: Error type 3: Activity Class {...} does not exist

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM