John R. John R. - 1 year ago 2392
Android Question

Session 'app': Error Launching activity

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 but it's installed in my emulator.
This is what comes up in the Run tab :

Unexpected error while executing: am start -n "com.example.user.ypologismosmoriwn/com.example.user.ypologismosmoriwn.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity

Here is the code:

package com.example.user.ypologismosmoriwn;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {

It's just an empty Activity,nothing added

and the XML code is just a Relative Layout with 4 Texts and 3 Check Boxes

This is the logcat i am getting

Thanks anyone who is willing to help

Answer Source

I also faced this issue after I updated to AS2.0. I found it is because the instant run is 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 my temporarily 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 gradle files, after this process finished, you are able to run your app as normal.

Good Luck~