[英]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: 我的配置:
I ran the following commands in Visual Studio Code 我在Visual Studio Code中运行了以下命令
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: 以及以下信息:
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.