I have an INTELIJ(v12) android project successfully imported to AndroidStudio(v0.4.0). It works perfectly if I don't change anything in manifest. When I want to change the launcher activity and run, it outputs with the following error:
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.
When I click Sync Project with Gradle files it outputs:
Project Sync
The project 'TrackingEng' is not a Gradle-based project
Anyone has faced this problem? Any ideas?
Run settings:
For me it was a very specific problem, I've got a Lg g5 to test my application on, and to reset my apps data I uninstalled it on the phone, but the phone has a "nice" feature to don't uninstall apps immediatly so you might can reinstall them within one day. So the app was installed but not usable(disabled) after removing the app from the phone completely it worked.
This happens when you do the following
AS thinks you still have the app in your device.
tl;dr - To resolve this, you can simply disconnect your device after uninstalling the app and reconnect it.
I would face this problem when uninstalling the app via the device (i.e. dragging the app to the "Uninstall" option). But here is the proper way to uninstall:
Use the
./gradlew uninstallAll
command. This will prevent theError: Activity class {HomeActivity} does not exist.
error.Update:
If you’re lazy you can use the abbreviation for this task:
./gradlew uA
.Or define aliases for common gradle tasks in your
.bash_profile
, doing so will save time, typing, and you won’t have to remember every command nor worry about typos. I suggest doing this.for me, on android 6 when i uninstalled the app it actually went to disabled instead of being removed from device.
Settings > Apps > click on your app and uninstall
this fixed it for me
For me, on Android Studio 3.1.2 on Ubuntu 16.04, I met the same issue. This happens when my colleague changed the package name, and it is okay on his machine. Neither clean project nor rebuild project work.
I use Sync project with gradle files button on the top pannel of Android Studio and everything works well.
Just in case anyone runs into my issue and has no luck with the other solutions... I was trying to start an activity through adb for FireTV while debugging Amazon launcher integration. However, my project had 60 different build variants (multi-platform, multi-app project) and the ApplicationId didn't match any classpath since the runtime package (and classpaths) were different from the applicationId.
I was trying to run
adb shell am start -n com.myappid.example.packageone.packagetwo/com.myappid.example.packageone.packagetwo.MySplashActivity
(Of course I had tried many combinations with
com.runtimepath.example
since I had the added challenge of a different applicationId in my build.gradle and another at runtime)What finally helped was this post https://stackoverflow.com/a/36255727/5970652
Which revealed a different format!
com.myappid.example/com.runtimepath.example.packageone.packagetwo.MySplashActivity
So if you have a different runtime classpath try specifying with the build.gradle applicationId before the slash and the runtime classpath afterwards.
You can also get these values from
BuildConfig.APPLICATION_ID
andthis.getLocalClassName()
respectively if you want to log them in logcat.