Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

React Native 安卓运行报错 java.lang.NullPointerException

$ ./gradlew installDebug --stacktrace --info                                                                                         130 ?
Starting Build
Settings evaluated using settings file '/Users/zehao/Work/tpy/AwesomeProject/android/settings.gradle'.
Projects loaded. Root project using build file '/Users/zehao/Work/tpy/AwesomeProject/android/build.gradle'.
Included projects: [root project 'AwesomeProject', project ':app']
Evaluating root project 'AwesomeProject' using build file '/Users/zehao/Work/tpy/AwesomeProject/android/build.gradle'.
Evaluating project ':app' using build file '/Users/zehao/Work/tpy/AwesomeProject/android/app/build.gradle'.
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing /usr/local/opt/android-sdk/add-ons/addon-google_apis-google-23/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/23.0.1/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/25.0.2/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/platform-tools/package.xml
Parsing /usr/local/opt/android-sdk/platforms/android-23/package.xml
Parsing /usr/local/opt/android-sdk/sources/android-23/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/default/x86/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/google_apis/x86_64/package.xml
Parsing /usr/local/opt/android-sdk/tools/package.xml
Parsing /usr/local/opt/android-sdk/add-ons/addon-google_apis-google-23/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/23.0.1/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/25.0.2/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/platform-tools/package.xml
Parsing /usr/local/opt/android-sdk/platforms/android-23/package.xml
Parsing /usr/local/opt/android-sdk/sources/android-23/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/default/x86/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/google_apis/x86_64/package.xml
Parsing /usr/local/opt/android-sdk/tools/package.xml
Resource missing. [HTTP GET: https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom]
Resource missing. [HTTP HEAD: https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar]
Resource missing. [HTTP GET: https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0.pom]
Resource missing. [HTTP HEAD: https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.4.0/recyclerview-v7-23.4.0.jar]
Resource missing. [HTTP GET: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom]
Resource missing. [HTTP HEAD: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar]
Parsing /usr/local/opt/android-sdk/add-ons/addon-google_apis-google-23/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/23.0.1/package.xml
Parsing /usr/local/opt/android-sdk/build-tools/25.0.2/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha7/package.xml
Parsing /usr/local/opt/android-sdk/platform-tools/package.xml
Parsing /usr/local/opt/android-sdk/platforms/android-23/package.xml
Parsing /usr/local/opt/android-sdk/sources/android-23/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/default/x86/package.xml
Parsing /usr/local/opt/android-sdk/system-images/android-23/google_apis/x86_64/package.xml
Parsing /usr/local/opt/android-sdk/tools/package.xml
IOException: https://dl.google.com/android/repository/addons_list-3.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
IOException: https://dl.google.com/android/repository/addons_list-2.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
IOException: https://dl.google.com/android/repository/addons_list-1.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Failed to download any source lists!
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.NullPointerException
        at com.android.builder.sdk.DefaultSdkLoader.updateRepositories(DefaultSdkLoader.java:486)
        at com.android.build.gradle.internal.DependencyManager.collectArtifacts(DependencyManager.java:514)
        at com.android.build.gradle.internal.DependencyManager.gatherDependencies(DependencyManager.java:375)
        at com.android.build.gradle.internal.DependencyManager.resolveDependencyForConfig(DependencyManager.java:278)
        at com.android.build.gradle.internal.DependencyManager.resolveDependencies(DependencyManager.java:155)
        at com.android.build.gradl

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
IOException: https://dl.google.com/android/repository/addons_list-3.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
IOException: https://dl.google.com/android/repository/addons_list-2.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
IOException: https://dl.google.com/android/repository/addons_list-1.xml
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
Failed to download any source lists!
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

FAILURE: Build failed with an exception.

你没有设置 Android SDK ,build的时候会自动下载,但是google服务器需要翻墙,所以请先翻墙后,再次运行命令即可。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...