我有一个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

运行设置:


当前回答

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.

其他回答

在我的情况下,我卸载了应用程序从手机之后,问题开始了,但是,下面的命令为我工作。

在终端/cmd中执行以下命令

adb uninstall <package_name>

Package_name类似于com.example.applicationname 然后,尝试重新安装应用程序。它应该会起作用。

就我而言,这是因为我试图启动的应用程序在设备上为另一个用户安装了。进入设置->应用程序(所有应用程序)并选择应用程序。单击溢出菜单并选择“卸载所有用户”。

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

当您执行以下操作时,就会发生这种情况

连接您的设备/模拟器 从Android Studio (AS)运行应用程序 使用/测试应用程序,并将其从设备上卸载 连接到您的计算机 尝试从AS重新运行应用程序

AS认为你的设备上还有应用程序。

tl;dr -要解决这个问题,你可以简单地断开你的设备卸载应用程序后,重新连接它。

我有一部三星Galaxy。在上面的设置中搜索不起作用,因为它根本没有出现在我的应用程序设置中。

我通过在搜索栏中输入应用程序的名称在我的手机上找到了这个应用程序。我意识到它在“工作”(使用Mobile@Work)配置文件中,并删除了它。您可以通过“设置->工作配置文件->应用程序”找到配置文件的设置

我希望这能帮助到一些人,他们可能不会以同样的方式找到它,许多其他答案都可以在设置中找到。