java 即时运行不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42696952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 06:49:25  来源:igfitidea点击:

Instant run does not work

javaandroidandroid-studioandroid-intentadb

提问by Sherwyn Cardozo

I'm getting this issue in android studio 2.3 when I click on 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.

回答by Faakhir

This issue is only in Android Studio 2.3 which is still open in google issue TrackerYou can resolve it (for time being not a permeant solution because Instant run is needed) by disabling instant run in your android studio. goto-> Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run

此问题仅存在于 Android Studio 2.3 中,它仍然在谷歌问题跟踪器中打开 您可以通过在您的 android studio 中禁用即时运行来解决它(暂时不是永久解决方案,因为需要即时运行)。转到-> Android Studio -> 首选项 -> 构建、执行、部署 -> 即时运行

回答by Mohamed AbdelraZek

I get this error before and the solution that works for me is to Try unplug and plug the cable again and see if it works

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

回答by James L.

This is happening for some specific devices because some manufacturers have customized their devices and added some sort of "auto-start" blocker. For affected Asus devices, for example, you can fix this issue by enabling Auto-start for your app with Asus's Auto-start Manager. See this page for details: https://www.asus.com/support/faq/1013752

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

But different manufacturer seems to do this differently. For example, for LeEco devices, you can allow "auto-launch" under settings. See this issue (https://github.com/openstf/stf/issues/407#issuecomment-247852532) for info on how to enable auto-launch for your app.

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

You can Google how to turn off such autostart/autolaunch feature for your specific device to get Instant Run to work. You can also just use the emulator.

您可以谷歌如何为您的特定设备关闭此类自动启动/自动启动功能,以使 Instant Run 工作。您也可以只使用模拟器。

Hope that helps.

希望有帮助。