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:
None of the solutions above worked for me, I tried same app with different device it worked. Finally I noticed that the application is disabled.
That was the solution for my case
I faced a similar problem after refactoring.
This is what i did to resolve this issue:
Build
directoryAnd everything worked fine!
I think the key is to restart your IDE.
Hope this helps you or anyone else!
Edit:
If above steps doesn't work for you, then
deleting gradle cache
seems be a solution, as pointed out by @Yasitha.Edit 2
As suggested by a couple of users in the comments below, sometimes the issue can be resolved by completely removing and reinstalling the app from your device.
Simply type
adb uninstall <package>
in terminal to completely remove app from device.UPDATE for Android Studio 2.1 and up
When running Android Studio 2.1 and up you can also encounter this issue when you have the instant run option enabled in your preferences (is enabled by default).
To disable this option go to
Preferences
option in theAndroid Studio
top menu and look forInstant Run
so you can uncheck the first checkbox on that screen.Anyway that fixed it for me. Originally pointed out by user @yusufonder. I discovered this was the issue since gradle install still worked.
I think another reason that issue happen is that it is not fully deleted for all users on the device.
Go to Settings -> Apps - > Your Apps -> Click to the 3 dots on the top right -> Uninstall for all users
It works for me. It happen especially you change the icons of the app or messing around with the AndroidManifest.xml file.
If your app has only two word package name like[com.example] then all your class must be mentioned with full path in menifest like [com.example.SplashActivity] instead of relative path like[.SplashActivity] change this and delete all your build folder and re-run app . Hope it will help. Thanks
I faced this problem lately, and tried all suggestions above, and problem was not saved. Finally I changed a NDK, and problem was solved...
May be helpful for someone:--
Sometimes when testing on a device, the app doesn't uninstall properly. To verify and fix this: