private fun openUniApp(file: File) {
DCUniMPSDK.getInstance()
.releaseWgtToRunPathFromePath(
file?.name?.split(".")!![0],
file.absolutePath
) { code, pArgs ->
LogUtils.i(code, pArgs)
if (code == 1) {
DCUniMPSDK.getInstance().openUniMP(this, file?.name?.split(".")!![0])
}
}
}
- 发布:2021-12-29 08:59
- 更新:2022-01-26 11:25
- 阅读:779
产品分类: uni小程序SDK
手机系统: Android
手机系统版本号: Android 11
手机厂商: 华为
手机机型: 随意
页面类型: vue
SDK版本号: 3.2.16
示例代码:
操作步骤:
private fun openUniApp(file: File) {
DCUniMPSDK.getInstance()
.releaseWgtToRunPathFromePath(
file?.name?.split(".")!![0],
file.absolutePath
) { code, pArgs ->
LogUtils.i(code, pArgs)
if (code == 1) {
DCUniMPSDK.getInstance().openUniMP(this, file?.name?.split(".")!![0])
}
}
}
private fun openUniApp(file: File) {
DCUniMPSDK.getInstance()
.releaseWgtToRunPathFromePath(
file?.name?.split(".")!![0],
file.absolutePath
) { code, pArgs ->
LogUtils.i(code, pArgs)
if (code == 1) {
DCUniMPSDK.getInstance().openUniMP(this, file?.name?.split(".")!![0])
}
}
}
预期结果:
正常打开小程序
正常打开小程序
实际结果:
无法打开小程序
无法打开小程序
bug描述:
java.util.zip.ZipException: error in opening zip file
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at java.util.zip.ZipFile.open(Native Method)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at java.util.zip.ZipFile.<init>(ZipFile.java:265)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at java.util.zip.ZipFile.<init>(ZipFile.java:187)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at java.util.zip.ZipFile.<init>(ZipFile.java:201)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at io.dcloud.common.util.ZipUtils.upZipFile(SourceFile:8)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at io.dcloud.feature.unimp.c.a(SourceFile:64)
2021-12-29 08:52:23.866 7572-7572/ W/System.err: at io.dcloud.feature.sdk.DCUniMPSDK.releaseWgtToRunPathFromePath(SourceFile:2)
注:附件为操作的小程序包,如果手动解压放入 assets/apps/appId/www目录下是可以的