gradle – Failed to install all-ThrowExceptions

Exception or error:

I am using React Native 0.26 and trying to play around with Google Plus Sign in from the below npm for Android application.

npm install react-native-google-signin --save

I am using command-line(react-native run-android) to build debug apks directly on my devices.

Followed all the installation steps very carefully. By default, my builds are working only on Build tools version 1.2.3 on build.gradle(/android/) and it used to work for other projects but I am having the below error in this project because I had to include the below line in build.gradle file,

classpath '' // <— add this

and when I add this, I also have to modify the distributionUrl to https\:// on android/gradle/wrapper/

After doing all the modifications when I tried to run the build command, it never installs the updated apk on the device and it is stuck at 99% progress.

Below is the detailed error,

Installing APK 'app-debug.apk' on 'Micromax Q372 - 5.0' for app:debug
08:26:35 E/1526411097: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
Unable to install /home/sid/react/gplus/android/app/build/outputs/apk/app-debug.apk Failed to install all 


:app:installDebug FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:installDebug'. Failed to install all
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

How to solve:

I had the same issue trying to install an APK on a specific device.

To solve I listed all the connected devices with adb devices and I identified the right one, then I ran run-android specifying the device ID:

react-native run-android --deviceId MY-DEVICE-ID

Leave a Reply

Your email address will not be published. Required fields are marked *