即时运行不起作用

时间:2017-03-09 13:41:51

标签: java android android-studio android-intent adb

当我点击run:

时,我在android studio 2.3中遇到了这个问题
03/09 19:02:36: Launching app
$ adb shell am startservice 

com.a890m.s/com.android.tools.fd.runtime.InstantRunService
Error while executing: am startservice com.a890m.s/com.android.tools.fd.runtime.InstantRunService

Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.a890m.s/com.android.tools.fd.runtime.InstantRunService }

Error: Not found; no service started.

3 个答案:

答案 0 :(得分:5)

此问题仅适用于仍在谷歌问题Tracker中打开的Android Studio 2.3 您可以通过在Android工作室中禁用即时运行来解决它(暂时不是因为需要立即运行而不是渗透性解决方案)。 goto-> Android Studio - >偏好 - >构建,执行,部署 - >即时运行

答案 1 :(得分:0)

之前我收到此错误,对我有用的解决方案是尝试拔下并重新插上电缆,看看它是否有效

答案 2 :(得分:0)

某些特定设备正在发生这种情况,因为一些制造商已经定制了他们的设备并添加了某种类型的“自动启动”设备。阻滞剂。例如,对于受影响的华硕设备,您可以通过使用华硕的自动启动管理器为您的应用启用自动启动来解决此问题。有关详细信息,请参阅此页:https://www.asus.com/support/faq/1013752

但不同的制造商似乎有不同的做法。例如,对于LeEco设备,您可以允许"自动启动"根据设置。有关如何为您的应用启用自动启动的信息,请参阅此问题(https://github.com/openstf/stf/issues/407#issuecomment-247852532)。

您可以在Google上为特定设备关闭此类自动启动/自动启动功能,以使Instant Run正常运行。您也可以使用模拟器。

希望有所帮助。

相关问题