JoKr
JoKr

Reputation: 5256

Session 'app': error when trying to run app

I haven't been working in Android Studio last 2 weeks, now i come back to change something in my app, and i can't debug apps anymore on my smartphone.

I get this Event Log:

21:55:16 Gradle build finished in 4 sec
21:55:16 Session 'app': running
21:55:20 Session 'app': error

And my app doesn't start at all. This happens with all projects and they used to run on same device before perfectly. Apps are still working on Genymotion, but not on my smartphone.

I tried restarting everyting (AS, pc, phone) but nothing helped. There was exact same problem posted, but they got nothing. When trying to google i find only 3 relevant results, so probably very rare problem.

Logs aren't showing any unusual errors.

Upvotes: 3

Views: 25330

Answers (6)

Bishnu Dudhraj
Bishnu Dudhraj

Reputation: 277

I had a similar error when I use emulator but when I run in Android phone it was solved.

  • Clean or rebuild the app and run in Android phone.
  • Uninstall the app if it is already there.

Upvotes: 0

JoKr
JoKr

Reputation: 5256

Finally solved it.

I was experimenting something with my default install location before. At some point i set instal-location to 2, which means external storage (SD card). This totally screws AS, so i had to revert it:

Run cmd from your sdk folder:

 adb devices
 adb shell pm set-install-location 1

Edit: As you can see from other answers you can get same error for other issues. You might want to look other answers and find what could be your problem.

Upvotes: 2

Nikhil Borad
Nikhil Borad

Reputation: 2085

For me problem was that Android Studio couldn't find my Default Activity. I just deleted that class file and again copied t. When I specified the activity with intent filter to catch the MAIN action intent and that caused the 'Error Launching activity' issue.

Upvotes: 0

lilbyrdie
lilbyrdie

Reputation: 1907

My root issue was what @fancy stated. However, I also had to go in to File->Invalidate Caches/Restart before it would work -- even after a full clean build.

To summarize:

  • Check your gradle file for debuggable false/true (thanks @fancy)
  • Invalidate caches & restart
  • Check your install location (thanks @Gudin)
  • Restart adb (thanks @ɯɐuʇɐs)

Upvotes: 4

smaug
smaug

Reputation: 936

When the emulator has started, open Task Manager and in Processes, search for abd.exe and kill it. Its not exactly a solution, but after everything else fails, try this.

Upvotes: 0

fancy
fancy

Reputation: 2149

For me it was a different issue. I used the 'release' flavor for debugging purposes. If I switch the flavor to 'debug', it works perfectly fine again.

Apparently 'release' has the the 'debuggable' configuration set to 'false' and 'debug' to true.

Upvotes: 3

Related Questions