因此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="dev@cordova.apache.org" 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。
答案 0 :(得分:-1)
检查build.gradle
文件中的以下行
project.ext {defaultBuildToolsVersion=29 defaultMinSdkVersion=19 defaultTargetSdkVersion=29 defaultCompileSdkVersion=29}