Com.android.ddmlib.InstallException: Failed to establish a response session

I am trying to run an interactive Android application in a nexus5 emulator

adb devices List of devices attached emulator-5554 device 

react-native start wrapper react-native start

works - react-native run-android

Installing APK 'app-debug.apk' on 'reactnative (AVD) - 6.0' Failed to install examples / android / app / build / output / apk / app -debug.apk

 com.android.ddmlib.InstallException: Failed to establish session at com.android.ddmlib.Device.installPackages(Device.java:894) at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:113) at com.android.builder.testing.ConnectedDevice$installPackages$0.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.groovy:119) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226) 
+58
android react-native
Sep 15 '15 at 4:32
source share
14 answers

For Mi devices

for those who suffer from this, try what the lyronessa mentions on Github.

  1. enable developer mode - on the phone, go to "Settings", "About phone" and click on the MIUI version 7 times. You will see a popup saying that you are a developer.
  2. Go back to Settings , Advanced settings , Developer options and enable USB debugging .
  3. Connect the phone to the PC / Mac and authorize your computer on the phone
  4. Go back to the developer options , scroll down to find Enable MIUI Optimization and disable it. Your phone will reboot
  5. Try it now :)
+240
Sep 10 '16 at 11:29
source share

Try: react-native run-android --deviceId YOUR_ID .

+15
Aug 13 '17 at 22:26
source share
It is known that

adb is flaky. Try:

  • Restarting adb with $ adb kill-server
  • Emulator restart
  • Using Genymotion instead of a spare Google emulator.
+9
Sep 15 '15 at 20:48
source share

In the settings of the AVD emulator, try to make sure that the option "Use host GPU" is set, and restart the emulator and try again.

+7
Oct. 21 '15 at 23:14
source share

In my case, I have to run this command in
/ sdklocation / platform-tools /

  adb kill-server 

then run again and see the installation request on the phone.
hope this helps someone

+4
06 mar. '17 at 7:41
source share

For those who like this problem in the emulator, one more tip: try to free up available storage space in the emulator . It worked for me.

So many test applications and previous developed applications installed by XD

+2
Aug 31 '17 at 11:48
source share

If you have already installed the application on the device, uninstall it. It works for me

+1
Feb 14 '17 at 11:55
source share

If your device or emulator has an application that has the same name as the application you are creating. Just delete the old one. This will solve the problem.

+1
Mar 25 '19 at 6:04
source share

Even I had the same problem, but restarting genymotion and running run-and-and-run-runroid worked again for me. Before running the specified command, make sure that the genymotion function is running.

0
Aug 22 '17 at 7:36 on
source share

Probable cause

I recently ran into this problem, first I developed an application called "myApp" in CordovaJS where the application domain was com.myapp and it was installed (this was a few months before I reacted). Then, when I switched to responsive-native, I made an application with the domain com.myapp and ran into the same problem as you.

Therefore, I realized that there were conflicts when it came to the domain and source.

Decision :

Remove the application whose domain is similar to the one you are installing, for example com.example, then reboot the phone.

It worked for me, I hope it works for you too.

0
Feb 26 '18 at 14:54
source share

01 - remove the application installed on the device

03- then run

  • adb kill-server

02 -Then run again

  • react-native android launch
0
Sep 11 '18 at 4:17
source share

This issue occurs on Xiomi devices. In the version for developers, you do not need to disable MIUI optimization (disabling does not synchronize your accounts), instead enable the option "Debugging via USB" along with "Install via USB" and "Debugging via USB (security settings)". This will solve the problem :)

0
Mar 30 '19 at 7:18
source share

try the following command: killall java

it worked for me. These may be Java processes running in the background.

0
May 27 '19 at 13:15
source share
 Sometimes it may happened due to insufficient storage within emulator.Try something like below: 1. Stop emulator 2. Open AVD Manager -> Wipe Data 3. Start emulator and run your project. 
0
Jul 09 '19 at 5:52
source share



All Articles