Activity class does not exist (Error type 3)

天大地大妈咪最大 提交于 2019-11-28 11:48:04

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.

Looks like there are lot of possible issues that causes this error. In my case I had changed the Installation options (see below steps to know where is Installation options) to "APK from app bundle"

Here is how I resolved it. May be helpful for someone.

  1. In AndroidStudio (AS) under "Run" Toolbar/Menu select "Edit configurations" menu item.
  2. In the Run/Debug Configuration popup Window, under "Android App" select "app"
  3. To the rightside, under "General" tab check if Module: app is selected.
  4. Under "Installation Options", "Deploy: " was selected wrongly. Selected back to"Default APK" and everything worked properly there after.

Installation Option Screen Shot

If you are getting this error, it may be because the app that you are trying to load is still installed for another user account on the same device.

In other words, uninstalling an app for the current user account does not necessarily uninstall the same app for all other user accounts on the device.

If you go into Settings => App and look for the device in question, you will see that it may still be there. If that is the case, Tap on the app to show the App Info screen and goto the "..." overflow menu on the upper right hand side. Tap that and there should be an option to uninstall the app for all users.

Once you have uninstalled the app for all users, this error should go away and you should be able to load and run the app.

I have the same issue with my project. I resolve it by navigating to file and clicking on Invalidate Caches/Restart.

In my case, the installation of the "Deploy: Default APK" option in Android Studio was helpful

On the phone having the problem go to: Settings Apps. If you see the app in the list select it and uninstall from there.

Seems as if just drag to uninstall doesn't really uninstall it.

Another great android feature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!