“错误类型3错误:活动类{}不存在",错误类型3活动类不存在“启动活动时 [英] "Error type 3 Error: Activity class {} does not exist" ,Error type 3 Activity class does not exist " while launching Activity

查看:160
本文介绍了“错误类型3错误:活动类{}不存在",错误类型3活动类不存在“启动活动时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我重命名了我的android项目包名称,然后在运行该项目时出现了以下两个错误:

Recently I renamed my android project package name, then when I ran the project it gave these two errors:

Error type 3 Error: Activity class {} does not exist
Error type 3 Activity class does not exist

我检查了我的 build.gradle ,发现 applicationId 没有变化.更新后,什么都没有解决.相同的错误不断显示.一个出现,然后我做某事,然后另一个出现...,依此类推.

I checked my build.gradle and found the applicationId didn't change. After updating it, nothing was solved. The same errors kept showing. One appears, then I do something, then the other appears...and so on.

经过大量搜索后,他们建议清理项目并删除一些文件夹(例如 .gradle build )并在重新启动Android Studio之后重建项目,但没有其中的一个解决了我的问题.

After a lot of searching, they suggested cleaning the project and deleting some folders (like .gradle and build) and rebuilding the project after restarting Android Studio, but none of that solved my problem.

有什么建议吗?

推荐答案

问题可能出在您的清单文件中.检查AndroidManifest.xml文件.

The problem could be in your Manifest file. Check the AndroidManifest.xml file.

检查活动"声明中是否存在那些意图过滤器.如下所示.

Check the presence of those intent-filters inside your Activity declaration. Like below.

<activity
     android:name=".main.SplashScreenActivity"       
     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>

如果存在此信息,则可能发生了某些缓存问题.然后,尝试以下方法:

If this information is there, maybe some cache problem occurred. Then, try this:

转到文件->使缓存无效/重新启动...

Go to File -> Invalidate Caches / Restart...

这篇关于“错误类型3错误:活动类{}不存在",错误类型3活动类不存在“启动活动时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆