Session 'app': Error Launching activity

前端 未结 30 2482
佛祖请我去吃肉
佛祖请我去吃肉 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 07:07

    Just run adb uninstall <package name> in your terminal and reinstall the app again.

    Hope it helps.

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

    Adb also throws this error if applicationId, package of launching activity or module name contains error substring

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

    I had this error because of my stupidity. In the manifest.xml I have wrongly declared two Activity as Launcher. Make sure you have only one activity as Launcher.

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
       <activity android:name=".WelcomeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    
    0 讨论(0)
  • 2020-11-28 07:10

    I had the same error as in the headline. after I changed the version name and version code in the gradle, the sync happened and then it worked. so maybe even only sync can help sometimes.

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

    This is issue with 2.0+ studio

    Issue 206036: No local changes, not deploying APK

    I found the nice workaround here just add -r flag here in edit configurations and also disabling instant

    Waiting to get Instant run Feature run smoothly soon with no type 3 error more!!

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

    Uninstall App on your real device or emulator. Then Run again. It's worked for me. I used Android Studio 2.3.3

    0 讨论(0)
提交回复
热议问题