简体   繁体   English

运行Android应用程序(离子Cordova)错误“无法找到到所请求目标的有效证书路径”

[英]Run android application (ionic cordova) error “unable to find valid certification path to the requested target”

I'm not very familiar with js technologies and I'm working on a Typescript project (with ionic cordova) for android. 我对js技术不是很熟悉,并且正在从事Android的Typescript项目(使用ionic cordova)。 I've retrieved this project from a colleague. 我已经从一位同事那里检索了这个项目。 The project works on its environment. 该项目在其环境下工作。

My configuration: 我的配置:

  • Visual Studio Code 1.30 for Windows 64 Windows 64的Visual Studio代码1.30
  • Android SDK 28 Android SDK 28
  • Ionic cli 4.8.0 离子CLI 4.8.0
  • Cordova 8.1.2 科尔多瓦8.1.2
  • Java 8 Java 8
  • right env vars JRE_HOME and ANDROID_SDK 正确的环境变量JRE_HOME和ANDROID_SDK

I ran the following commands in Visual Studio Code 我在Visual Studio Code中运行了以下命令

  1. "npm i" the first time 第一次“ npm i”
  2. ionic cordova build android 离子科尔多瓦建立Android

The second triggers the following exception: 第二个触发以下异常:

Exception in thread "main" javax.net.ssl.SSLHandshakeException:  sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:145) 
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131) 
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)

Moreover, when I start "ionic serve", a localhost page is opened on my browser. 此外,当我开始“离子服务”时,在我的浏览器上会打开一个本地主机页面。 First the webapp is displayed one second, and then an error page is displayed: 首先,将webapp显示一秒钟,然后显示错误页面:

"Uncaught (in promise): cordova_not_available" “未捕获(承诺):cordova_not_available”

With the following stack: 使用以下堆栈:

c@http://localhost:8100/build/polyfills.js:3:19752 
c@http://localhost:8100/build/polyfills.js:3:19461 
f/<@http://localhost:8100/build/polyfills.js:3:20233 F</l</t.prototype.invokeTask@http://localhost:8100/build/polyfills.js:3:15649 onInvokeTask@http://localhost:8100/build/vendor.js:5436:24
F</l</t.prototype.invokeTask@http://localhost:8100/build/polyfills.js:3:15562 
F</c</r.prototype.runTask@http://localhost:8100/build/polyfills.js:3:10815 
o@http://localhost:8100/build/polyfills.js:3:7887

And the following informations: 以及以下信息:

  • Ionic Framework 3.9.2 离子框架3.9.2
  • Ionic App Scripts 3.2.1 Ionic应用程序脚本3.2.1
  • Angular Core 5.2.11 角核5.2.11
  • Angular Compiler CLI 5.2.11 Angular编译器CLI 5.2.11

I don't know what is wrong, particularly when the project works on the pc of my colleague. 我不知道出什么问题了,特别是当该项目在我同事的电脑上工作时。 So I assume I don't have anything to do in the project configuration files. 因此,我假设我在项目配置文件中没有任何事情。

Now it's working on "ionic cordova build browser" but not "ionic cordova build android" (android is defined as a platform in package.json). 现在,它可以在“ ionic cordova build browser”上运行,但不能在“ ionic cordova build android”上运行(android在package.json中定义为平台)。

I don't have any idea of what to do. 我不知道该怎么办。 Have you any idea ? 你有什么主意吗? Thanks ! 谢谢 !

Finally, after some days I've found the problem was the installed JRE. 终于,几天后,我发现问题出在已安装的JRE。 I uninstalled my current JRE 8 and installed another version and it's work fine. 我卸载了当前的JRE 8并安装了另一个版本,它工作正常。

However, I don't understand why but it's ok now. 但是,我不明白为什么,但是现在还可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法找到到请求目标的有效证书路径 - unable to find valid certification path to requested target 无法找到到请求目标的有效证书路径 - unable to find a valid certification path to requested target 间歇性 SSL 错误:无法找到到请求目标的有效认证路径 - Intermittent SSL error: unable to find valid certification path to requested target Android服务器应用程序:SSLHandshakeException(无法找到到请求目标的有效证书路径) - Android Server-Application: SSLHandshakeException (unable to find valid certification path to requested target) gradlew 无法找到请求目标的有效认证路径 - gradlew unable to find valid certification path to requested target 突然“无法找到到请求目标的有效认证路径” - Sudden "unable to find valid certification path to requested target" SunCertPathBuilderException:无法找到所请求目标的有效证书路径 - SunCertPathBuilderException: unable to find valid certification path to requested target` “无法在Camel组件测试中找到所请求目标的有效证书路径” - “unable to find valid certification path to requested target” in Camel Component Test LibGDX:找不到到请求目标的有效认证路径 - LibGDX: Unable to find valid certification path to requested target 临时 - 无法找到到所请求目标的有效认证路径 - Temporary - unable to find valid certification path to requested target
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM