简体   繁体   中英

Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.

If the "Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled." issue occurs while using the latest Gradle Plugin & Latest Android SDK. You can use the below solution as mentioned in the screenshot

在此输入图像描述

In your gradle file just enable 3 options as per the diagram (default always all options will be enabled).

This solution weirdly worked for me. I don't know it is studio issue or something else with Gradle plugin. But Some one have better solution or exact solution please share across.

Enable your ADB Integration. Go to Tools --> Android --> set checked in Enable ADB Integration

参考屏幕截图

Go to -- app-->Edit Configurations-->Launch options In Launch select --> Specified Activity apply then press ok button.

now you may run the program

图片

Firstly, If the Android Device Monitor is opened, close it and then select "Enable ADB Integration"

Hope this helps someone:

For me what fixed it was closing the Android Device Monitor I could not Enable ADB Integration until then.

I ran into this error after opening my Android Studio 2.3.3 on March 25, 2019. The last time I had accessed my projects was earlier in 2018. I started Android Studio 2.3.3 and opened projects that I had previously created and ran fine. A bunch of stuff was broken. Apparently parts of Android Studio or dependencies, or related packages, had been updated in the background and that broke all my old projects.

Just to get Gradle to sync on opening projects, I had to download and install Android SDK 27. Fumbled through a few more issues which I will omit. I didn't do a good job of recording them and they are not pertinent to this question.

Finally got to the point where I could run my project and the emulator launched just fine but Android Studio wasn't able to start the project. It just sat there waiting. Closed everything and restarted. Tried running the project on an emulator again and I got Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.

Here is a screen shot of how the error displayed:

错误消息的屏幕截图。

I referred to some of the other answers to this problem posted on this thread. Android 2.3.3 settings dialog is a little different than the newest Android Studio.

To fix the problem I went to "File -> Settings -> Build, Execution, and Deployment -> InstantRun". At the top of the dialog is a check box for "Enable Instant Run to hot swap code/resource changes on deploy. I attached a screen shot of my settings.

Android 2.3.3即时运行设置

I closed and restarted Android Studio. Opened my project and clicked the run button. The emulator started and the compiled app launched. Problem resolved for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM