本文介绍了在Windows上React-native run-android失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-----环境---------------
操作系统:Windows 10版本1709
节点:8.9.1
npm:5.5.1
react-native-cli:2.0
react-native:0.56.0
Nox模拟器:6.0.0.0
问题描述:
这是关于使用命令react-native run-android运行一个简单的应用程序。
您将收到以下所示的错误消息。
在C中扫描符号链接的文件夹:\ Users \ jmsuarez \ RefactNativeProjects \ProyJMInit45 \ node_modules(107ms)
启动JS服务器...
在设备上构建和安装应用程序(cd android&& gradlew.bat installDebug)...
下载https://services.gradle.org/distributions/gradle-3.5.1-all。 zip
............................................. .................................................. .....................
线程main中的异常javax.net.ssl.SSLException:连接已关闭:javax.net.ssl。 SSLException:SSL对等关闭错误
at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1517)
at sun.security.ssl.AppInputStream.available(AppInputStream.java:60)
at java.io.BufferedInputStream.available(BufferedInputStream.java:399)
at sun.net.www.MeteredStream.available(MeteredStream.java:170)
at sun.net.www。 http.KeepAliveStream .close(KeepAliveStream.java:85)
at java.io.FilterInputStream.close(FilterInputStream.java:181)
at sun.net.www.protocol.http.HttpURLConnection $ HttpInputStream.close(HttpURLConnection .java:3128)
at org.gradle.wrapper.Download.downloadInternal(Download.java:77)
at org.gradle.wrapper.Download.download(Download.java:44)
在org.gradle.wrapper.Install $ 1.call(Install.java:59)
at org.gradle.wrapper.Install $ 1.call(Install.java:46)
at org.gradle。 wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor。 java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
引起:javax.net.ssl.SSLException:SSL对等关闭错误
at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:4 26)
at sun.security.ssl.InputRecord.read(InputRecord.java:378)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:947)
at sun .security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:904)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.read1(BufferedInputStream) .java:273)
在java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.MeteredStream.read(MeteredStream.java:134)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at sun.net.www.protocol.http.HttpURLConnection $ HttpInputStream.read(HttpURLConnection.java:3058)
at sun.net。 www.protocol.http.HttpURLConnection $ HttpInputStream.read(HttpURLConnection.java:3052)
at org.gradle.wrapper.Download.downloadInternal(Download.java:62)
... 7 more
无法在设备上安装应用,请阅读上面的错误详情。
确保您正在运行Android模拟器或连接设备,并设置
设置您的Android开发环境:
https://facebook.github.io/react-native/docs/getting -started.html
欢迎任何有助于解决问题的贡献或建议。
我尝试了什么:
我尝试完成了错误日志建议的步骤。
实际上我连接了android模拟器。我可以使用命令adb devices看到它。
我得到了使用Nox模拟器和Android Studio模拟器时出现相同的错误。
解决方案
-----Environment--------------- OS: Windows 10 version 1709 Node: 8.9.1 npm: 5.5.1 react-native-cli: 2.0 react-native: 0.56.0 Nox emulator: 6.0.0.0 Problem description: It's about running a simple application with the command react-native run-android. You get the error message that is shown in the following. " Scanning folders for symlinks in C:\Users\jmsuarez\ReactNativeProjects\ProyJMInit45\node_modules (107ms) Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)... Downloading https://services.gradle.org/distributions/gradle-3.5.1-all.zip .................................................................................................................... Exception in thread "main" javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: SSL peer shut down incorrectly at sun.security.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1517) at sun.security.ssl.AppInputStream.available(AppInputStream.java:60) at java.io.BufferedInputStream.available(BufferedInputStream.java:399) at sun.net.www.MeteredStream.available(MeteredStream.java:170) at sun.net.www.http.KeepAliveStream.close(KeepAliveStream.java:85) at java.io.FilterInputStream.close(FilterInputStream.java:181) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(HttpURLConnection.java:3128) at org.gradle.wrapper.Download.downloadInternal(Download.java:77) at org.gradle.wrapper.Download.download(Download.java:44) at org.gradle.wrapper.Install$1.call(Install.java:59) at org.gradle.wrapper.Install$1.call(Install.java:46) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:46) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: javax.net.ssl.SSLException: SSL peer shut down incorrectly at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:426) at sun.security.ssl.InputRecord.read(InputRecord.java:378) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:947) at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:904) at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) at java.io.BufferedInputStream.read1(BufferedInputStream.java:273) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.MeteredStream.read(MeteredStream.java:134) at java.io.FilterInputStream.read(FilterInputStream.java:133) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3058) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052) at org.gradle.wrapper.Download.downloadInternal(Download.java:62) ... 7 more 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/getting-started.html " Any contribution or suggestion that helps to solve the problem is welcome.
What I have tried:
I tried done the steps that the error log suggests.
In fact I have the android emulator connected. I can see it using the command adb devices.
I get the same error using both Nox emulator and also the Android Studio´s emulator.
解决方案
这篇关于在Windows上React-native run-android失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!