Error running mobile app

Asked

Viewed 852 times

0

When executing react-native run-android gives the following error:

FAILURE: Build failed with an Exception.

  • What Went Wrong: Execution failed for task ':app:mergeDebugResources'.

    Error: java.util.Concurrent.Executionexception: com.android.ide.common.process.Processexception:

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

FAILED BUILD

Total time: 2 mins 21,254 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: https://facebook.github.io/react-native/docs/getting-started.html

Information from the JDK:

java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-B13) Java Hotspot(TM) 64-Bit Server VM (build 25.181-B13, Mixed mode)

Information on the React-Native:

React-Native-cli: 2.0.1 React-Native: 0.55.4

I tried to run on Genymotion, on the phone itself and Android Studio, but gives the same error.

API 23 and 28.

2 answers

2

Linux and macos

Run the following commands on the terminal, or save them inside one of these existing files on your system: ~/. bash_profile , ~/. profile or ~/. zshrc

export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools

Then run the following command:

~/Android/Sdk/tools/bin/sdkmanager  "platform-tools" "platforms;android-27" "build-tools;27.0.3"

If you have any questions: https://github.com/Rocketseat/ambiente-react-native/blob/master/unix-android-sdk.md

Windows

Perform the following steps of this tutorial: https://github.com/Rocketseat/ambiente-react-native/blob/master/windows-android-sdk.md

Source: https://github.com/Rocketseat/ambiente-react-native

0

Caio, a question, has the environment variable ANDROID_HOME set? If you do not know, run the command: echo $ANDROID_HOME for mac or linux. If you haven’t set the variable, set it by pointing to where your Android SDK is.

If the variable is set, do the following:
Open Genymotion > Settings > ADB > Check the box Use custom Android SDK tools > Select the folder that is set your ANDROID_HOME.

  • Hello Thiago, did not have the variable ANDROID_HOME, I configured all the variables and I put a path to the SDK in Genymotion, but is giving the same error.

  • @Caiolucasteixeiraf.O. when you give the android command, it identifies the variable?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.