如何用:cordova plugin add cordova-plugin-file-opener2
可能会出现如下错误:
com.android.ide.common.process.ProcessException: Failed to execute aapt at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796) at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551) at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
建议使用:cordova plugin add https://github.com/JuanjoPP/cordova-plugin-file-opener2
使用方法:
var target="/sdcard/Download/ionic.apk";
cordova.plugins.fileOpener2.open(target, 'application/vnd.android.package-archive');
参考:
https://www.cnblogs.com/liaolei1/p/7639844.html
https://github.com/pwlin/cordova-plugin-file-opener2/issues/202