1

I recently build fresh app using react-native init.

After run react-native run-android I got this error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_112\bin\java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 19.52 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:
https://facebook.github.io/react-native/docs/android-setup.html

(node:3632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
(node:3632) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've already tried to run gradlew clean inside my android folder but still no luck.

Any solution?

ssuhat
  • 7,387
  • 18
  • 61
  • 116
  • Have a look at this [question](http://stackoverflow.com/questions/23847482/error-gradle-execution-failed-for-task-apppredexdebug) and [this one](http://stackoverflow.com/questions/25529155/android-studio-gradle-error-predexdebug) – martinarroyo Jan 03 '17 at 09:04

1 Answers1

0

Had the same issue, and after a lot of troubleshooting I found out that the android project was corrupted. Here's how I fixed mine:

From project folder:

  1. rm -rf android
  2. react-native upgrade

Note: just running react-native upgrade without deleting the android folder does not seem to work.

corym
  • 382
  • 1
  • 4
  • 14