問題:cordova打包項目后,在Android8.0及以上版本更新下載后,不能打開APP的問題?
原因:cordova官網提示 android 8.0 需要添加配置文件。
Android APK安裝限制 打開APK文件進行安裝時,以下限制適用: 在Android 8+上,您的應用程序必須具有ACTION_INSTALL_PACKAGE權限。
解決方法:
在您的應用程序config.xml文件來添加它:
<platform name="android"> <config-file parent="/manifest" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> </config-file> </platform>