Android版本更新问题:ionic+cordova打包后,android8.0及以上权限公开问题

问题: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>

猜你喜欢

转载自www.cnblogs.com/renxiaoren/p/12575061.html
今日推荐