详细问题描述
(DCloud产品不会有明显的bug,所以你遇到的问题大都是在特定环境下才能重现的问题,请仔细描述你的环境和重现方式,否则DCloud很难排查解决你的问题)
[内容]
集成2019年07月24日发布的5+SDK报错
控制台日志:
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: java.security.NoSuchAlgorithmException: class configured for SecureRandom (provider: Crypto) cannot be found.
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at java.security.Provider$Service.getImplClass(Provider.java:1688)
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at java.security.Provider$Service.newInstance(Provider.java:1631)
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
2019-09-05 09:50:54.381 22228-22513/com.freshjn.shop W/System.err: at sun.security.jca.GetInstance.getInstance(GetInstance.java:218)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.security.SecureRandom.getInstance(SecureRandom.java:392)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.adapter.util.DCloudTrustManager.createSecureRandom(DCloudTrustManager.java:56)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.adapter.util.DCloudTrustManager.getSSLSocketFactory(DCloudTrustManager.java:76)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.createConnection(NetTool.java:209)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.request(NetTool.java:75)
2019-09-05 09:50:54.382 22228-22513/com.freshjn.shop W/System.err: at io.dcloud.common.util.NetTool.httpGet(NetTool.java:31)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.httpGet(NetTool.java:39)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.TestUtil$PointTime.commitTid(TestUtil.java:754)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.TestUtil$PointTime.commitTid(TestUtil.java:649)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.a.d$7.run(WebApp.java:2385)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.lang.Thread.run(Thread.java:764)
重现步骤
[步骤]
[结果]
[期望]
[如果语言难以表述清晰,拍一个视频或截图,有图有真相]
IDE运行环境说明
[HBuilder 或 HBuilderX。如果你用其他工具开发uni-app,也需要在此说明]
[IDE版本号] android studio3.5
[windows版本号]
[mac版本号]
uni-app运行环境说明
[运行端是h5或app或某个小程序?]
[运行端版本号] Android9.0
[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]
[编译模式是老模板模式还是新的自定义组件模式?] widge集成模式
App运行环境说明
[Android版本号] Android9.0
[iOS版本号]
[手机型号] 一加7Pro
[模拟器型号]
附件
[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]
[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]
[App安装包或H5地址]
[可重现代码片段]
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: java.security.NoSuchAlgorithmException: class configured for SecureRandom (provider: Crypto) cannot be found.
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at java.security.Provider$Service.getImplClass(Provider.java:1688)
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at java.security.Provider$Service.newInstance(Provider.java:1631)
2019-09-05 09:50:54.381 22228-22513/com.xx.shop W/System.err: at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
2019-09-05 09:50:54.381 22228-22513/com.freshjn.shop W/System.err: at sun.security.jca.GetInstance.getInstance(GetInstance.java:218)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.security.SecureRandom.getInstance(SecureRandom.java:392)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.adapter.util.DCloudTrustManager.createSecureRandom(DCloudTrustManager.java:56)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.adapter.util.DCloudTrustManager.getSSLSocketFactory(DCloudTrustManager.java:76)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.createConnection(NetTool.java:209)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.request(NetTool.java:75)
2019-09-05 09:50:54.382 22228-22513/com.freshjn.shop W/System.err: at io.dcloud.common.util.NetTool.httpGet(NetTool.java:31)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.NetTool.httpGet(NetTool.java:39)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.TestUtil$PointTime.commitTid(TestUtil.java:754)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.util.TestUtil$PointTime.commitTid(TestUtil.java:649)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at io.dcloud.common.a.d$7.run(WebApp.java:2385)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2019-09-05 09:50:54.382 22228-22513/com.xx.shop W/System.err: at java.lang.Thread.run(Thread.java:764)
参考:
https://www.jianshu.com/p/4533f43022f7
联系方式
[QQ] 345575199
DCloud_Android_zl
重新说明一下问题,以及这个问题造成的影响。
2019-10-28 11:32
s***@163.com
回复 DCloud_Android_zl: The Crypto provider has been deleted in Android P (and was deprecated in Android N), so the code will crash.
报错代码:SecureRandom.getInstance(SHA1PRNG, "Crypto")
这个是因为Crypto provider 在Android9.0中已经被Google删除了,调用的话就会发生crash。
2019-11-13 19:06
DCloud_Android_zl
回复 s***@163.com: 说明一下机型,我这边无法复现。
2020-04-15 11:13