React-native: Error with react-native run-android for gradle version gradle-2.4-all.zip

Created on 29 Aug 2016  路  7Comments  路  Source: facebook/react-native

Getting following error in every project that has distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip in android/gradle/wrapper/gradle-wrapper.properties. When i change the gradle version to gradle-2.2.1-all.zip, everything works fine.

$ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug...
Exception in thread "main" java.lang.NullPointerException
    at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:34)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:25)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
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
Locked

Most helpful comment

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 21 mins 38.128 secs

All 7 comments

@preetb123 I encountered this problem because just install npm install react-native-vector-icons --save && react-native link.

So i try to change use your way, now it can work, very thanks.

I have tried bt it does not working for me.

I also experienced this error after using the react-native upgrade, i had to change the file to say
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 21 mins 38.128 secs

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

i try this but not work

Was this page helpful?
0 / 5 - 0 ratings