Development issue/problem:

The APK debugging installation failed on my device.

jianglinghuadeMacBook-Pro: hello jianglinghua$ react-native run-android
The JS server is already running.
Build and install the application on the device (android cd & & ./gradlew installDebug…
WARNING [Project: :app] The current NDK support is deprecated. An alternative will be proposed in the future.
:app:preBuild UP-TO-DATE
…….
:app:assemblyDebug UP-TO-Date
:app:installDebug
Installing APK ‘app-debug.apk’ on ‘MI NOTE LTE – 6.0.1’
Unable to install /Users/jianglinghua/Desktop/hello/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Error when installing session.com.android.ddmlib.Device.installPackages (Device.java: 894) ……… at org.gradle.wrapper.GradleWrapperMain.main (GradleWrapperMain.java: 61):app:installDebug FAILED

SAFETY : The design failed with one exception.

*
The ‘:app:installDebug’ task failed.
> com.android.builder.testing.api.deviceException: com.android.ddmlib.InstallException : The session could not be established

*
Execute the –stacktrace option to get a stack trace. Use the –info or –debug option to get more output data.

CONSTRUCTION FILE

Total duration: 13.945 sec

The application could not be installed on the device, see the error above for details.
Make sure the Android emulator is running or the device is connected and
has configured your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html.

I look at my cameras

jianglinghuadeMacBook-Pro: hello jianglinghua$ show devices
device list attached
98333978 device

How can I solve this problem?

Solution 1:

Since you are using a mi phone that has ….. has…

Try this

Go to development options, scroll down to enable and disable MIUI optimization. Your phone is rebooted

look at sb./sth.

If you are using another Android phone with a custom user interface/name on top of the Android operating system, try disabling and checking the optimization of this interface.
(This information is usually found under Developer Options).

Solution 2:

I had that question. Mine worked fine on the emulator, but not on the device, and the error was

app:installDebug FAILED.

If you have another application with the same name (or package name) on the device:
Rename the application or remove it from your device.

Solution 3:

In my case I installed a new application but I had an error, I tried different ways and possible answers from github and stackoverflow.
nothing works

Error
Enter image description here
The solution for me was … Check if you already have an application with the same name installed on Android…..

Remove old applications and run a reactive run-android

It worked for me.

Solution 4:

On my Android device, the problem was in previous versions of the application I had previously installed on my phone.
the following steps solved my problem:

  1. Removal of all previous versions of the application, including the debug version and the signed apk version.
  2. in the root directory of your project, run (under Windows) :

Android CD

The thermometer is clean

CD…

npm pure cache – Performance

  1. Restart the Android device

I hope this helps you too.

Solution no. 5:

I have the same problem and did some research. This problem is common with Chinese Android phones.

Fixed the problem by changing the gradle version to 1.2.3 in the android/build.gradle file on line 8.

Classpath ‘com.android.tools.build:gradle:1.2.3’.

Solution no. 6:

Works for me.

  1. To remove an application from your phone
  2. Android CD
  3. Sorting machine
  4. CD…
  5. run-android-reactive navigation

Solution no. 7:

  1. Go to android/build.gradle, edit

Classpath ‘com.android.tools.build:gradle:2.2.3’
to

Classpath ‘com.android.tools.build:gradle:1.2.3’.

  1. Then go to
    android/gradle/gradle-wrapper.properties,
    change theURL distribution to https://services.gradle.org/distributions/gradle-2.2-all.zip.
  2. Run it again.

Solution no. 8:

If none of the above works, try the following steps to start the cold emulator

Open the AVD Manager -> Edit Device -> Show Advanced Settings -> Boot Option -> Cold boot instead of Fast boot.

Solution no. 9:

In my case (using React Native), my Android phone was not recognized by my PC where I was running the server, which can be seen in the post :

*
The ‘:app:installDebug’ task failed.
> com.android.builder.testing.api.deviceException : No online devices found.

If this is the case, as described in the ADB Android Device Unauthorized section, make sure your phone’s Developer Options section has USB debugging set to true, and type the following commands in the restart command for the Android device or server.

Ad Killer
Startup Server

And promotional devices should list your phone as a device, not an unauthorized device.

Solution no. 10:

In my case, I downloaded the application from the PlayStore and tried to debug the APK with the same name. I just uninstalled the application and successfully debugged it.

Good luck!

app:installdebug stuckreact-native error device offlinereact native run android device is nullavd settingsbash: .gradlew: command not foundhow to enable use host gpu in android studioapp:validatesigningdebug react-nativenpx react-native run-androidreact native cliinstall_failed_version_downgrade react-nativetask :app:mergeextdexdebug failedgradlew cleanadb devices unauthorizedunable to locate adbcheckexecsyncerror react-nativecommand failed: gradlew bat build lintreact-native run-android stuck26 actionable tasks 1 executed 25 up to date27 actionable tasks 2 executed 25 up to datebase.apk code is missinginstall_failed_invalid_apkinstall_failed_update_incompatibleinstall_failed_version_downgradeerror: command failed: gradlew.bat app:installdebug -preactnativedevserverport=8081execution failed for task ‘:app:installdebug’ no connected devicesexecution failed for task ‘:app:packagedebug react-nativegradlew installdebugreact native run-androidtask :app:mergedexdebug failed