Cordova插件文件Android Q权限错误

问题描述 投票:0回答:1

因此,Android 10破坏了Cordovas插件文件,因为它给出了与此更改相关的权限错误:https://developer.android.com/training/data-storage#scoped-storage

我遇到了这个可能的解决方案https://github.com/bumptech/glide/issues/3896,但是Cordova似乎不支持它。

以下config.xml产生错误

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="[email protected]" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:allowBackup="false" />
        <application android:fullBackupContent="false" />
        <application android:requestLegacyExternalStorage="true" />
    </edit-config>
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <engine name="android" spec="^8.1.0" />
</widget>

../debug/AndroidManifest.xml:22: AAPT: error: attribute android:requestLegacyExternalStorage not found.

我的Android Studio显示正在使用的最新SDK。

android cordova cordova-plugins phonegap android-10.0
1个回答
-1
投票

检查build.gradle文件中的以下行

© www.soinside.com 2019 - 2024. All rights reserved.