Session 'app': Error Launching activity

前端 未结 30 2484
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 06:43

After the Android Studio 2.0 update while the gradle build finishes I get this :

Session \'app\': Error Launching activity .

It prevents the app from starting

相关标签:
30条回答
  • 2020-11-28 06:55

    I got the same problem and fixed it with this answer.

    But this problem was created by myself, as I tried to debug my unit tests. Therefore I had to uncheck the Use in-process build option of the AS Settings in Build, Execution, Deployment > Compiler.

    So in my case it works, if I disabled instant run. But it also works, as I enabled instant run and also the Use in-process build option.

    0 讨论(0)
  • 2020-11-28 06:55

    I tried, clean & rebuild project and Invalidate Cache & Restart also manually removed .gradle and .idea folders, but that didn't solved the issue.

    I have 3 user acounts in my phone. So, I didn't select Uninstall for all users, and it only uninstall my app from first user account, but it was still there in guest and second user account.

    So, I removed it from rest of the accounts and it solved my issue!!

    0 讨论(0)
  • 2020-11-28 06:58

    I tried the above answer. However, none of the solutiond worked for me. I changed the emulator to USB and the code is running on the USB target device prefectly!

    0 讨论(0)
  • 2020-11-28 07:01

    Try reinstalling the app, this solved the error for me. The trick was that, I uninstalled my app, but Android didn't truly uninstall it. On my phone, there is a guest user (my sister uses it sometimes). If you uninstall the app from your main user, it will still be available on the phone, but only for the guest user. It looks like Android Studio can't handle this case. I guess it detects that the app is installed, so it will not be reinstalled again for the current user, hence the OS can't access and launch the activity. Nice bug, I'll report it.

    0 讨论(0)
  • 2020-11-28 07:02

    I got the same error. This issue was caused by uninstalling the app from the device (uninstalled from only 1 user)

    Solved by logging into the other user and uninstall the app from there.

    and it solved.

    0 讨论(0)
  • 2020-11-28 07:03

    Same issue, but for me problem was that Android Studio couldn't find my Default Activity. When I specified the intent filter to catch the MAIN action intent, I didn't specify the LAUNCHER category, and that caused the 'Error Launching activity' issue.

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />  <-- forgot
        </intent-filter>
    
    0 讨论(0)
提交回复
热议问题