36

I have updated android studio from 2.2 to 2.3,then I found Instant run not working.

Error while executing: am startservice com.example.codingmaster.testcc/com.android.tools.fd.runtime.InstantRunService Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.codingmaster.testcc/com.android.tools.fd.runtime.InstantRunService } Error: Not found; no service started.

I also try reinstall android studio 2.3 but not work.

Vishal Chhodwani
  • 2,567
  • 5
  • 27
  • 40
user6138207
  • 363
  • 1
  • 3
  • 6
  • 7
    Workaround, Go to Settings and Disable Instant Run. it works after that :) – KuriaNdungu Mar 03 '17 at 07:22
  • I also have the same problem, and when I disabled Instant Run running the app gives this error: Error while executing: am start -n "project...../project......MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.String, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Ljava_lang_String_2Ljava_lang_String_2) – Dasser Basyouni Mar 03 '17 at 10:06
  • Turning Instant Run let it works after a reboot – Dasser Basyouni Mar 03 '17 at 13:23
  • I have the same issue. To launch my app, I must disable in Settings the Instant Run mode. I report this bug to google. Have you got multi-flavors in your project ? I think it's the cause in my case. I have the following line in gradle logs: "Incremental Java compilation disabled in variant [...] as you are using 3 source folders : ..." – GCO Mar 03 '17 at 15:16
  • yes. I have flavors for speed up Multi-Dex for lollipop, but with or without it instant run is buged – Dasser Basyouni Mar 04 '17 at 08:35

11 Answers11

22

In case you are running a device with MIUI, go to Developer Settings > Turn on MIUI optimization and turn it off.

You will then need to restart your device and recompile the code.

Instant Run should then work again

Kishan Gohel
  • 453
  • 4
  • 12
15

Found a solution. You have to enable auto-start support for other device manufacturers (example ASUS, LeEco and some others).

For LeEco -

  1. Install the app with Instant Run. It should fail (If it doesn't, why are you reading this in the first place?)

  2. Go to Settings.

  3. Look for Permissions under Personal.

  4. Choose "You have allowed X apps to autolaunch". Toggle <Your app name> ON.

  5. Done! Instant Run works.

For ASUS, give that app Auto-Start permission with Auto Start Manager. See here for more information.

For other devices, please find some similar setting.

EDIT -

If you have disabled auto-start in the Purify (or other similar app), please re-enable it.

Source - https://code.google.com/p/android/issues/detail?id=235879

FadedCoder
  • 1,517
  • 1
  • 16
  • 36
  • 1
    That worked for me but it was purify engine not built-in settings – Dasser Basyouni Mar 12 '17 at 17:44
  • on MIUI it doesn't help. only disabling MIUI optimization option helps, anyway your solution isn't good, it would be stupid to change autostart for every debuged app – user25 Apr 01 '17 at 16:26
  • @user25 That's the only option because Google can't do anything about it. It is manufacturer specific. – FadedCoder Apr 01 '17 at 18:06
12

I was facing to the same issue too with an Asus phone.

Error while executing: am startservice com.eyelights.android/com.android.tools.fd.runtime.InstantRunService
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.myapp.android/com.android.tools.fd.runtime.InstantRunService }
Error: Not found; no service started.

Thanks to this post, i was able to start my app again :

https://code.google.com/p/android/issues/detail?id=235879

Go in Android Studio Preferences :

enter image description here

Disable Instant Run like this :

enter image description here

Now you can run your app again. Don't forget to enable again Instant run when you switch phone.

It's not the perfect solution, but it's working

$ adb shell am start -n "com.myapp.android/com.myapp.android.activity.SplashScreenActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 16367 on device asus-asus_z00ed-F9AZCY208273
Kevin ABRIOUX
  • 16,507
  • 12
  • 93
  • 99
5

click this


from 2.3 There is new icon.

see this.

Soo Chun Jung
  • 595
  • 3
  • 14
5

If you're using an Asus Zenfone, make sure that the Auto Start Manager doesn't block your app from running.

3
  • Goto File-settings, "Build, Execution, Deployment"
  • click on instantRun
  • Uncheck Enable instant run Checkbox
  • then apply and ok will solve your problem
mkl
  • 90,588
  • 15
  • 125
  • 265
Paramatma Sharan
  • 437
  • 5
  • 11
2

disable instant run. This bug in issue tracker: https://code.google.com/p/android/issues/detail?id=235879

Andrew Glukhoff
  • 898
  • 11
  • 9
2

Instant Run Documentation:

To start using Instant Run, you also need to change the build variant to a debug version of your app and deploy it to a target device running Android 5.0 (API level 21) or higher. To learn about more techniques that speed up your build, read Optimize Your Build Speed

so make sure your build variant is set to 'debug'.

chad
  • 141
  • 1
  • 5
2

If you are using Genymotion with ARM Translation, you need to create a new image without it installed, and Instant Run will work fine.

dompardoe
  • 83
  • 11
0

You need to update your gradle first then after instant run work..

To take advantage of all the latest features (such as Instant Run), improvements and security fixes, we strongly recommend that you update the Android Gradle plugin to version 2.3.0 and Gradle to version 3.3.

Thanks

Jd Prajapati
  • 1,953
  • 13
  • 24
  • 1
    I had update android gradle plugin to version 2.3 and gradle to 3.3 but still not work.My device is xiaomi 5s run miui 8 – user6138207 Mar 03 '17 at 12:37
0

I had same problem by using Android Studio 2.3.2 and solved the issue by adding these codes in gradle file.

defaultConfig {
    ...
    minSdkVersion 15
    targetSdkVersion 25
    ...

    // Enabling multidex support.
    multiDexEnabled true
}

 dependencies {
     compile 'com.android.support:multidex:1.0.0'
 }
AppHero2
  • 681
  • 7
  • 25