While trying to build your React Native Android app, if you get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unable to upload some APKs
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 17.878 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
it could be because of three things:
1. If you are using a device, your device is not plugged in correctly. Make sure you can see it when you run
adb devices on the commandline.
2. If you are using an emulator,the emulator is not running or it has not booted up yet.
3. Your app is configured to use a buggy version of gradle. Version
1.3.1 is well known to cause this problem.
The most likely cause of this problem will gradle version
In my experience, upgrading gradle did not fix the problem. To fix it, I had to downgrade it to a rather memorable version of
com.android.tools.build:gradle:1.3.1 in the
android/build.gradle, and update it to
With this, you will have fixed the problem of "Unable to upload some APKs" in React Native Android.