我使用“react-native init helloworld”创建了示例react-native项目。当我运行“React-Native Run-Android”时,我会不断地看到以下错误。我尝试与解决方案提供类似的解决方案在这些链接。但它并没有解决问题。
后1后2
react原生项目中的Android Build.Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-4.4-all.zip
D:\My Projects\PULSE\Phase II\ReactNative\Projects\HellowWorld>react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/infer/annotation/infer-annotation/0.11.2/infer-annotation-0.11.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/infer/annotation/infer-annotation/0.11.2/infer-annotation-0.11.2.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.infer.annotation:infer-annotation:0.11.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/facebook/infer/annotation/infer-annotation/0.11.2/infer-annotation-0.11.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/facebook/infer/annotation/infer-annotation/0.11.2/infer-annotation-0.11.2.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.fresco:fresco:1.10.0.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.facebook.fresco:fresco:1.10.0.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.10.0/fresco-1.10.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.10.0/fresco-1.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.fresco:fresco:1.10.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/facebook/fresco/fresco/1.10.0/fresco-1.10.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/facebook/fresco/fresco/1.10.0/fresco-1.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.10.0.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.10.0.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.10.0/imagepipeline-okhttp3-1.10.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.10.0/imagepipeline-okhttp3-1.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.10.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/facebook/fresco/imagepipeline-okhttp3/1.10.0/imagepipeline-okhttp3-1.10.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/facebook/fresco/imagepipeline-okhttp3/1.10.0/imagepipeline-okhttp3-1.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.soloader:soloader:0.5.1.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.facebook.soloader:soloader:0.5.1.
> Could not get resource 'https://jcenter.bintray.com/com/facebook/soloader/soloader/0.5.1/soloader-0.5.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/facebook/soloader/soloader/0.5.1/soloader-0.5.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.facebook.soloader:soloader:0.5.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/facebook/soloader/soloader/0.5.1/soloader-0.5.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/facebook/soloader/soloader/0.5.1/soloader-0.5.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.code.findbugs:jsr305:3.0.2.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.google.code.findbugs:jsr305:3.0.2.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.code.findbugs:jsr305:3.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okhttp3:okhttp:3.10.0.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.squareup.okhttp3:okhttp:3.10.0.
> Could not get resource 'https://jcenter.bintray.com/com/squareup/okhttp3/okhttp/3.10.0/okhttp-3.10.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/squareup/okhttp3/okhttp/3.10.0/okhttp-3.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okhttp3:okhttp:3.10.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/squareup/okhttp3/okhttp/3.10.0/okhttp-3.10.0.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/squareup/okhttp3/okhttp/3.10.0/okhttp-3.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.10.0.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.10.0.
> Could not get resource 'https://jcenter.bintray.com/com/squareup/okhttp3/okhttp-urlconnection/3.10.0/okhttp-urlconnection-3.10.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/squareup/okhttp3/okhttp-urlconnection/3.10.0/okhttp-urlconnection-3.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.10.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.10.0/okhttp-urlconnection-3.10.0.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.10.0/okhttp-urlconnection-3.10.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okio:okio:1.14.0.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve com.squareup.okio:okio:1.14.0.
> Could not get resource 'https://jcenter.bintray.com/com/squareup/okio/okio/1.14.0/okio-1.14.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/squareup/okio/okio/1.14.0/okio-1.14.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.squareup.okio:okio:1.14.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/squareup/okio/okio/1.14.0/okio-1.14.0.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/squareup/okio/okio/1.14.0/okio-1.14.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.webkit:android-jsc:r174650.
Required by:
project :app > com.facebook.react:react-native:0.57.0
> Could not resolve org.webkit:android-jsc:r174650.
> Could not get resource 'https://jcenter.bintray.com/org/webkit/android-jsc/r174650/android-jsc-r174650.pom'.
> Could not HEAD 'https://jcenter.bintray.com/org/webkit/android-jsc/r174650/android-jsc-r174650.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve org.webkit:android-jsc:r174650.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/webkit/android-jsc/r174650/android-jsc-r174650.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/org/webkit/android-jsc/r174650/android-jsc-r174650.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 27s
1 actionable task: 1 executed
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
由于某些原因,“cacerts”
文件损坏-位于我的本地PC中的“C:\Program Files\java\jdk1.8.0_181\jre\lib\security”
。因此,在重新安装jdk1.8.0_181
之后,我能够解决这个问题。
连接Ex:javax.net.ssl.sslHandShakeException:Sun.Security.Validator.ValidatoreXception:PKIX路径构建失败:Sun.Security.Provider.CertPath.SunCertPathBuilderException:找不到请求目标的有效证书路径 代码:
下面是idea.log http://pastebin.com/kyhfrbp9
我已经使用Homebrew安装了java(11-OpenJDK11.0.2)、scala(2.13.1)和sbt(1.3.4)。然后我尝试向Java的密钥库添加证书: 但当我尝试使用sbt(通过idea或从console)时,我会遇到这样的错误: ::::错误服务器访问错误:PKIX路径构建失败:sun.security.provider.certpath.suncertpathbuilderEx
首先,我知道以前有人问过这个问题,但我尝试了提出的解决方案,但没有结果。 我正在尝试用java开发一个简单的程序,它连接到一个网站,并从那里托管的文本文件中读取。一开始我以为证书会造成问题,因为在没有收到警告的情况下,我无法在firefox上打开网站。Internet explorer不会产生任何问题。代码如下: 我尝试的第一件事是Java提供的解决方案:sun.security.provider
我刚刚安装了最新的Android Studio,我得到了标题中的错误;我尝试了互联网上的许多解决方案,但都不起作用。 所以请你帮我修一下好吗? 我收到此错误: 该项目是Android Studio中的基本项目示例。
我正在使用WSO2 API管理器和Keyclope服务器进行API网关和用户身份验证。两者都在Openshift 3.11上运行。在浏览器上,尝试重定向到wso2 apim上的存储页面时出现以下错误。此外,我正在为这两个服务器使用一个使用keytool生成的自签名证书,它还分别导入到JVM cacerts中。Open JDK版本为1.8。 我在使用javax时遇到了致命的问题。网ssl。SSLEx