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:
I had the same issue and I solved it refactoring my activity launcher, just change the class name and it works.
I also faced the same problem somewhere in the past. Such problems actually occurs when we do some refactoring like - renaming, moving files within the project etc. Renaming and Moving files require changes in the gradle file so whenever you rename or move some file just clean the project:
Cleaning the project just removes the .class files and recompiles the project. Basically, it forces a project rebuild.
Sometimes such types of errors did not cleaned on cleaning project then try to uninstall the app from the device (either it is emulator or physical one) and run the app again. Hope this will help you, it helps me 50% times.
Note:- Whenever you got any error just don't go to google, Clean the project if this not work do what you want to google.
My solution is: close the "instant run" of android studio.
"instant run" can be found with the following steps: Preferences -> Build,Execution,Deployment -> Instant Run
and then uncheck the checkbox "Enable Instant Run to hot swap...."
I had the same error after renaming/refactoring. What I did was add the
applicationId
property attribute to my build.gradle file, and set its value to the application package.In build.gradle:
For me, the problem was that
AndroidStudio
thought that the app was still on the device.To fix it:
restart the
adb
daemon; in a terminal or command prompt, enter:try to launch your app.
if it still doesn't work, check out this answer.
make sure the
platform-tools
of the Android SDK is added to your system path variables!Got to
android/app/build.gradle
and search forYou might have something like
Chose the
buildType
you want to start and then start the App the followingSo,