Error type 3 Error: Activity class {} does not exist
I faced a similar problem after refactoring.
This is what i did to resolve this issue:
- Cleaned the Project
- Deleted the
Build
directory - Restarted Android Studio
- Rebuild the Project
- Run
- Optionally (Go to the files menu on android, click on "Invalidate Caches / Restart..." uninstall the app on your phone and try again)
And everything worked fine!
I think the key is to restart your IDE.
Edit 1:
If the above steps don't work for you, then deleting Gradle cache seems to 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 the device.
Edit 3
As mentioned in Abhishek's Answer, one should also try deleting the app from your device in case multiple users are set up on your device.
Simply go to Mobile Settings > Apps > [Your App] > More > Uninstall App for All Users
Edit 4
As mentioned by Yassin Ajdi, executing the uninstallAll
Gradle task can also fix the issue.
You can go to Gradle > Tasks > Install > uninstallAll
to get the job done.
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 the Preferences
option in the Android Studio
top menu and look for Instant 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.
Error type 3 Error: Activity class {} does not exist
I faced a similar problem after refactoring.
This is what i did to resolve this issue:
- Cleaned the Project
- Deleted the
Build
directory - Restarted Android Studio
- Rebuild the Project
- Run
- Optionally (Go to the files menu on android, click on "Invalidate Caches / Restart..." uninstall the app on your phone and try again)
And everything worked fine!
I think the key is to restart your IDE.
Edit 1:
If the above steps don't work for you, then deleting Gradle cache seems to 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 the device.
Edit 3
As mentioned in Abhishek's Answer, one should also try deleting the app from your device in case multiple users are set up on your device.
Simply go to Mobile Settings > Apps > [Your App] > More > Uninstall App for All Users
Edit 4
As mentioned by Yassin Ajdi, executing the uninstallAll
Gradle task can also fix the issue.
You can go to Gradle > Tasks > Install > uninstallAll
to get the job done.
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 the Preferences
option in the Android Studio
top menu and look for Instant 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.
Activity class does not exist (Error type 3)
On some devices (LG Stylus 3 Android 7.0) when you press and move app from desktop to trash can the app does not removed from device. You can restore app trashed by this way later without reinstalling it from Google Play. If it is your case you may see this error:
Error while executing: am start -n "ru.alanov.cashbox/ru.alanov.cashbox.activity.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.your.app/.activity.MainActivity }
Error type 3
Error: Activity class {ru.alanov.cashbox/com.your.app.activity.MainActivity} does not exist.
Error while Launching activity
when trying to reinstall app from Android Studio thru ADB. Go to Settings -> Applications -> Click on your app and delete it. After it error disappears.
Error type 3 - Error: Activity class MainActivity does not exist
It happened after I uninstalled the app directly from android device.
To solve it, I ran:
adb devices
-- to get the connected devices list
followed by:
adb -s device android id uninstall package.name
Then, I ran again in android device with success
Edit:
to clarify the bold texts:
device android id is one of id you'll get after type adb devices.
Typing it, you'll get a list of connected devices with the ids
package.name is the text on top of your kotlin/java files, after the "package", like com.yourname.appname
Error type 3 - Activity class does not exist
I discover that there was something wrong with the android studio, I haven't found the root cause of the problem yet, but the problem was fixed by uninstalling the android studio and install it from another source.
Error type 3 Error: Activity class {} does not exist
I faced a similar problem after refactoring.
This is what i did to resolve this issue:
- Cleaned the Project
- Deleted the
Build
directory - Restarted Android Studio
- Rebuild the Project
- Run
- Optionally (Go to the files menu on android, click on "Invalidate Caches / Restart..." uninstall the app on your phone and try again)
And everything worked fine!
I think the key is to restart your IDE.
Edit 1:
If the above steps don't work for you, then deleting Gradle cache seems to 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 the device.
Edit 3
As mentioned in Abhishek's Answer, one should also try deleting the app from your device in case multiple users are set up on your device.
Simply go to Mobile Settings > Apps > [Your App] > More > Uninstall App for All Users
Edit 4
As mentioned by Yassin Ajdi, executing the uninstallAll
Gradle task can also fix the issue.
You can go to Gradle > Tasks > Install > uninstallAll
to get the job done.
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 the Preferences
option in the Android Studio
top menu and look for Instant 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.
Error type 3: Activity Class {...} does not exist
In build.gradle
, the line:
apply plugin: 'android-library'
needs changed to:
apply plugin: 'com.android.application'
Related Topics
Android Google Maps API V2 Zoom to Current Location
How to Send a Simple Email Programmatically? (Exists a Simple Way to Do It)
How to Get References for All Currently Active Fragments in an Activity
The Android Emulator Is Out of View, How to Move It
Bitmap, Bitmap.Recycle(), Weakreferences, and Garbage Collection
Animation in Notification Bar Custom View
Executing Multiple Asynctask's Parallely
How to Get Screen Size of Device
Access Files from Assets/Www Directory
How to Get a Non Scrollable Listview
How to Access Localhost from a Genymotion Android Emulator
Android Wifi How to Detect When Specific Wifi Connection Is Available
Android:How to Update the Selector(Statelistdrawable) Programmatically
Android Listview Setselection() Does Not Seem to Work
Enable and Disable Auto Rotate Programmatically
How How to Do Ussd Requests on Android