Session 'app': Error Launching activity

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

    I also faced this issue after I updated to AS2.0. I found that it is because of the instant run enabled. So my solution is to disable the "instant run". and it worked. To disable "instant run", you can go to Preference Dialog ( May be Setting dialog on Windows), then select Build, Execution, Deployment > Instant Run, and uncheck all the checkbox to disable Instant Run.

    This is my temporary solution and it may help you. Later, I'll find a better way to this issue.


    update by 2016/06/06

    A better solution instead of disabling instant run. Remove the .idea folder and .gradle folder, then click button Sync Project with Gradle Files (or through the menu File -> Sync Project with Gradle Files), after this process finished, you are able to run your app as normal.

    Good Luck~

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

    Just disable Instant Run.

    Go To File >> Settings >> Build, Execute, Deployment >> Instant Run
    

    Uncheck The Box that says Enable instant run to hot swap code/resource changes on deploy

    Re-run the emulator.

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

    I've had same issue, rebuilding project clears the error for me.

    build -> rebuild project -> run

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

    None of the existing answers helped me as I had the same app installed in my other profile. Solution -

    1. Switch to the other profile
    2. Uninstall the app from 2nd profile
    3. Switch back
    0 讨论(0)
  • 2020-11-28 06:54

    All answers did not work for me.This error raised when I was trying to rename the app package.I have ended up creating a new project with the new package name and move my files to the new one.

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

    I spent a whole lot of hours on this exact issue. The "instant run" fix was a total fail. And I wasn't missing the android.intent.category.LAUNCHER I removed all applicable Android Studio and SDK code and re-installed. Still a no go.

    Ultimately I think my issue was marginal hardware. I'm running on a laptop with a AMD A6-4400M processor. There is no hardware acceleration / virtualization tools available. I was just running the standard Android Studio / Google emulator. It was painfully slow, and although I was eventually able to see the emulator and interact with it, I was never able to connect the emulator to Android Studio to upload APK's.

    But I did discover an awesome fix.

    • Remove all Android Virtual Devices and install the GenyMotion Emulator (with VirtualBox).
    • I've tried GenyMotion emulators before (with a Linux) and it didn't make much difference in load up speed.
    • On this Windows 10 machine it works exceptionally well. Its pretty quick, easily connects to Android Studio and works well deploying my apps.
    • GenyMotion offers one personal use device at no cost. Kudos to the GenyMotion team!

    Answer provided here in case anybody else gets stuck with this error, possibly with this root cause.

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