react-native run-android报 java.lang.NullPointerException



  • 这是报的异常:
    E:\study\AwesomeProject>react-native run-android
    JS server already running.
    Building and installing the app on the device (cd android && gradlew.bat install
    Debug)...
    Exception in thread "main" java.lang.NullPointerException
    at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMain
    Starter.java:34)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja
    va: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

    问题的起源:
    gradle-wrapper.properties :distributionUrl=https://services.gradle.org/distributions/gradle-2.4-all.zip
    react-native run-android的时候会根据上面配置文件配置的地址下载gradle,但是被强了,我自己上网下了gradle-2.4-all.zip包,把配置改为本地下载:
    distributionUrl=file:///E:/AwesomeProject/android/gradle-2.4-all.zip

    再去运行react-native run-android,就报java.lang.NullPointerException,请问怎么破?
    在线等~~~~


登录后回复