我有一个IntelliJ Android项目,我成功地导入到Android Studio 0.4.0。如果我不改变manifest中的任何东西,它就能很好地工作。然而,当我想要改变启动器活动并运行时,它会失败,并出现以下错误:

Launching application: com.trackingeng/LandingActivity.
DEVICE SHELL COMMAND: am start -D -n "com.trackingeng/LandingActivity"  
    -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN  
    cat=[android.intent.category.LAUNCHER] cmp=com.trackingeng/LandingActivity }
Error type 3
Error: Activity class {com.trackingeng/LandingActivity} does not exist.

当我点击同步项目与Gradle文件,它输出:

Project Sync
The project 'TrackingEng' is not a Gradle-based project

运行设置:


当前回答

我在不同的设备上尝试了相同的应用程序,它可以工作。最后我注意到应用程序被禁用:

进入设置/应用程序(在手机上) 如果已禁用,请将其移除

其他回答

在Android 6上,当我卸载应用程序时,它实际上变成了禁用,而不是从设备中删除。

>应用程序>单击你的应用程序并卸载

在android studio 3.5.1中遇到这个问题,花了我一天的时间来解决这个问题,尝试了所有的方法,包括清理缓存,重新启动和重命名包名。所以,如果以上任何一种方法都不起作用,那就试试这个。

只要去gradle > Tasks >安装>卸载

以下是链接: 错误类型3:活动类{…}不存在

以我为例,我不知道为什么,智能手机阻止了我的应用程序。为了解决这个问题,我去了配置->应用程序,找到我的应用程序,并按下“卸载”。我进入了配置,因为我的应用程序没有出现在菜单上。

Gradle ->任务->安装->全部卸载。

Had the same error, with a much newer version of Android Studio (version 4.1) . A fresh install of Android Studio + a fresh "basic Activity" template would run into error type 3 for hours. I am on win 10 - my problem was how to kill the gradle cache. A good answer above showed a screen snapshot from gradle, but i didn't find it in Android Studio 4.1. Also the env vars for gradle had not been set , and the commandline for gradle didn't work. So .. here is how it worked finally. I went to C:\Users\myusername\ .gradle. This has subdir "caches". I deleted everything inside. Worked ! I did close Android Studio before, restarted and then it worked nicely. Ah forgot one thing- i run the device emulator (defauöt device), i.e. no physical device yet.