2017-03-03 145 views
34

我已經更新了Android工作室從2.2到2.3,然後我發現即時運行無法正常工作。安卓工作室2.3即時運行不工作

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.

我也嘗試重新安裝android studio 2.3但不工作。

+7

解決方法,轉到設置並禁用即時運行。它的作品:) – KuriaNdungu

+0

我也有同樣的問題,當我禁用即時運行運行應用程序給出此錯誤:執行時出現錯誤:am start -n「project ...../project ...... MainActivity「-a android.intent.action.MAIN -c android.intent.category.LAUNCHER java.lang.UnsatisfiedLinkError:未找到針對java.lang.String的實現android.os.SystemProperties.native_get(java.lang.String, java.lang.String)(嘗試Java_android_os_SystemProperties_native_1get和Java_android_os_SystemProperties_native_1get__Ljava_lang_String_2Ljava_lang_String_2) –

+0

即時運行讓它在重新啓動後運行 –

回答

21

如果你正在運行的設備與MIUI,去開發人員設置>打開MIUI優化和關閉它。

然後,您將需要重新啓動設備,並重新編譯代碼。

即時運行應該再次工作

+0

嗨,會有我的MI手機上的任何重大變化,我會關掉它?(MIUI優化) –

+0

如果它的工作不正常。 –

+0

問題報告在谷歌跟蹤https://code.google.com/p/android/issues/detail?id=233579#c21 –

0

你需要即時後運行工作首先更新gradle這個的話..

要利用所有最新功能的優勢(如即時運行),改進和安全修補程序,我們強烈建議您必須更新Android搖籃插件2.3.0版本,並搖籃到3.3版本。

感謝

+1

我有更新的Android gradle這個插件版本2.3和gradle這個到3.3,但仍不能work.My設備是小米5S運行MIUI 8 – user6138207

5

click this


從2.3有新的圖標。

see this.

+2

這圖標運行會重新啓動應用程序!對我來說工作不正常... – MBH

+0

我是怎麼想這個的。謝謝! – MadScientist

14

找到了解決辦法。你必須啓用其他設備製造商(如華碩,LeEco和其他一些)自動啓動的支持。

對於LeEco -

  1. 安裝帶有即時運行的應用程序。它應該失敗(如果沒有,爲什麼你首先讀到這個?)

  2. 轉到設置

  3. 查找權限個人

  4. 選擇「您允許X應用程序自動啓動」。切換<Your app name>ON

  5. 完成!即時運行。

對於華碩,使用自動啓動管理器給予該應用程序的自動啓動權限。有關更多信息,請參見here

對於其他設備,請找一些類似的設置。

編輯 -

如果你有在Purify(或其他類似的應用程序)禁用自動啓動,請重新啓用它。

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

+1

爲我工作的工作,但它是淨化引擎沒有內置設置 –

+1

爲您的評論更新了答案,謝謝! MIUI上的 – FadedCoder

+0

沒有幫助。只有禁用MIUI優化選項幫助,反正你的解決方案是不好的,那將是愚蠢的變化自動啓動,每debuged應用 – user25

5

如果您使用的是華碩Zenfone,確保自動啓動管理器不從運行阻止你的應用程序。

+1

對於華碩zenfone max,轉到移動管理器(應用程序) - >自動啓動管理器,允許自動啓動您的應用程序的權限。 – ManishMenaria

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

所以請確保您構建變量被設置爲 '調試'。

1

如果您正在使用帶有ARM翻譯的Genymotion,則需要創建一個未安裝它的新映像,Instant Run將正常工作。

8

我也用華碩手機面對同樣的問題。

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. 

多虧了這個帖子,我能重新開始我的應用程序:

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

轉到Android Studio中首:

enter image description here

禁用即時這樣運行:

enter image description here

現在您可以再次運行您的應用程序。不要忘記在切換手機時再次啓用即時運行。

這不是完美的解決方案,但它的工作

$ 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 
0
  • 轉到文件的設置, 「建立,實施,部署」
  • 點擊instantRun
  • 取消選中啓用即時運行復選框
  • 然後申請並確定將解決您的問題
0

通過使用Android Studio 2.3.2,我遇到了同樣的問題,並通過在gradle文件中添加這些代碼解決了問題。

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

    // Enabling multidex support. 
    multiDexEnabled true 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.0' 
}