question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native run-android failed

See original GitHub issue

Describe your environment

  • React-Native version: 0.56.0
  • Platform: Android
  • Android Device & Simulator have same problem
  • react-native-languages version: 2.0.1
  • Android Studio version: 3.1.3
  • Buildtools version 25.0.3 is installed screen shot 2561-08-29 at 14 32 20

How to repeat issue and example

What I did?

  • Install and link this library
  • Implement the translation and get it works on iOS side running in simulator
  • Now on Android, the build is failed with command react-native run-android

Expected

  • The build command not failed and be able to run on Android simulator

Actually happen

  • The build is failed screen shot 2561-08-29 at 14 39 38

What I try to fix?

  • Change compileSdkVersion, buildToolsVersion, and targetSdkVersion in android/app/build.gradle and run the command react-native run-android but still gets the same error.

Solution

I think after change compileSdkVersion, buildToolsVersion, and targetSdkVersion to match this library setup would fix the issue, but after change it stills fail. Maybe I need to somehow rebuild Android gradle? (Sorry, I’m not experience with Android).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
panupongvmaqecommented, Sep 9, 2018

@zoontek - Upgraded to version 3.0.0 build on Android stills fail but with different error.

image

I try modify as @amfolio suggests, it fixes the error and be able to build successfully.

1reaction
tadeolincocommented, Sep 10, 2018

Got it to build by upgrading gradle.

// android/build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
}
// android/gradle/wrapper/gradle-wrapper.properties

...
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Build Failed on React-Native run-android?
You need to add ANDROID_HOME, JAVA_HOME variables in environmental variables and tools and platform-tools in path of system to run android apk.
Read more >
Fails to run react-native run-android (v0.68.0) without yarn
Description when I create a test project and enable new architecture and Hermes it's giving me this type error below:- NOTE:- I KNOW...
Read more >
React Native Android : FAILURE: Build failed with ... - A Shirazee
This is an issue with how Gradle is automating the build and the current version of the JDK installed on your machine, follow...
Read more >
Addressing common errors in React Native - LogRocket Blog
Failed to install the app · Open your React Native application in a text editor like VS Code · In the application's root...
Read more >
Troubleshooting - React Native
If you run into issue where executing npm run android on macOS throws the above error, try to run sudo chmod +x android/gradlew...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found