[英]Does not exist activity class file - why? [duplicate]
我不知道这个错误是什么:
05/19 15:21:12:在 LGE(我的手机)上启动“应用程序”。
$ adb shell am start -n "com.cukorders.helping/com.cukorders.helping.ChatActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Error while executing: am start -n "com .cukorders.helping/com.cukorders.helping.ChatActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER 开始: Intent { act=android.intent.action.MAIN cat=[android.intent .category.LAUNCHER] cmp=com.cukorders.helping/.ChatActivity } 错误类型 3 错误:活动 class {com.cukorders.helping/com.cukorders.helping.ChatActivity} 不存在。
启动活动时出错
但 ChatActivity 确实存在名为 ChatActivity.java
您的活动需要在清单文件中定义。 启动活动应该这样定义:
<activity android:name=".put your started activity name here"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
这个问题可能是因为Refactoring ,如果你已经这样做了。
可以这样解决:
单击文件>使缓存无效/重新启动
[1] 清理你的项目文件。
[2] 删除您的构建目录。
[3] 重启你的IDE(Android Studio)。
[4] 重建你的项目并运行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.