java – Error while Launching activity

Question:

Updated Android Studio, strange things started. I start the project – the error takes off:

04/09 15:14:22: Launching app
$ adb push D:\ASprojects\InnovationBeer\app\build\outputs\apk\app-debug.apk /data/local/tmp/eu.innovationpassport.innovationbeer
$ adb shell pm install -r "/data/local/tmp/eu.innovationpassport.innovationbeer"
    pkg: /data/local/tmp/eu.innovationpassport.innovationbeer
Success


$ adb shell am start -n "eu.innovationpassport.innovationbeer/eu.innovationpassport.innovationbeer.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "eu.innovationpassport.innovationbeer/eu.innovationpassport.innovationbeer.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity

The most interesting thing is that the program works, if you try to run it for a long time, it works 20+ times. I close the old application, sometimes restarting the phone and Android Studio doesn't even help.

Answer:

Run> Edit Configurations> left Android Application, app> Right Launch Options> Launch: Select Default Activity.
It helped me

Scroll to Top