Error with react-native run-android for gradle version gradle-2.4-all.zip
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
@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.
- What went wrong: A problem occurred configuring root project 'AwesomeProject'.
Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:2.2.3. Required by: :AwesomeProject:unspecified > Could not resolve com.android.tools.build:gradle:2.2.3. > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'. > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom'. > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connect
- 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: 21 mins 38.128 secs
Check my solution => https://stackoverflow.com/questions/43521533/error-could-not-find-or-load-main-class-org-gradle-wrapper-gradlewrappermain/44154693#44154693
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