简体   繁体   English

活动 class {} 不存在 android 3.5.1(即时运行不再可用)

[英]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.错误:活动 class {com.tectibet.loginapp/com.tectibet.loginapp.MainActivity} 不存在。我尝试清理缓存并重新启动,重建并清理。

I have tried changing manifest and build.gradle package name as well.我也尝试过更改清单和 build.gradle package 名称。 also I went through Error type 3 Error: Activity class {} does not exist but it didt work out.我也经历了错误类型 3 错误:活动 class {} 不存在,但它没有解决。

<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.执行时出错:am start -n "com.tectibet.loginapp/com.tectibet.loginapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER 开始:Intent { act=android.intent .action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tectibet.loginapp/.MainActivity } 错误类型 3 错误:活动 class {com.tectibet.loginapp/com.tectibet.loginapp.MainActivity} 不存在。

Option 1:选项1:

In build.gradle , the line:build.gradle中,该行:

apply plugin: 'android-library'

needs changed to:需求改为:

apply plugin: 'com.android.application'

Option 2:选项 2:

This is how i fixed it.这就是我修复它的方式。 go to gradle > Tasks > Install > UninstallAll go 到 gradle > 任务 > 安装 > 卸载全部

在此处输入图像描述

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.在 android studio 3.5.1 中遇到这个问题我花了一天时间来解决这个问题,尝试了一切,包括清理缓存、重启和重命名 package 名称。 So if any of above did't work than try this first.因此,如果上述任何一项都不起作用,请先尝试一下。 Error type 3 Error: Activity class {} does not exist 错误类型 3 错误:活动 class {} 不存在
If it did't work than try this method.如果它不起作用,请尝试此方法。

Just go to gradle > Tasks > Install > UninstallAll只是 go 到 gradle > 任务 > 安装 > 卸载全部

Here is the link: Error type 3: Activity Class {...} does not exist这是链接: 错误类型 3:活动 Class {...} 不存在

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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