I'm trying to update my cordova application to use SDK 30 instead of 29, and I have a problem I cannot resolve.
Apparently, the default value of setAllowAccessFile of the webview changed from true to false between Android SDK 29 and 30. Problem is, in my cordova app, I don't have access to the WebView API, and thus need to change this value with the config.xml file. But I cannot find any option that fits.
Or at least, I think the problem comes from here.
App is an Angular app packaged for Android with Cordova 10. I've tried to switch from Android 8.1.0 to Android 10, to add the new MANAGE_EXTERNAL_STORAGE permission, and a few other stuff I was pretty sure wouldn't work but, well... But nothing changed anything.
If you have any idea of how to do that, or where else the problem could come from, I'd gladly take your advice.
Thanks a lot.
config.xml :
<?xml version='1.0.0' encoding='utf-8'?>
<widget xmlns:android="http://schemas.android.com/apk/res/android" id="my.package.name" version="1.0.6" xmlns="http://www.w3.org/ns/widgets">
<name>My package name</name>
<description>
</description>
<author email="my.email@email.com" href="https://my.website">
My website
</author>
<content src="index.html"/>
<plugin name="cordova-plugin-whitelist" spec="1"/>
<plugin name="cordova-plugin-wkwebview-engine" spec="https://github.com/driftyco/cordova-plugin-wkwebview-engine.git"/>
<plugin name="cordova-plugin-wkwebview-engine" spec="1.2.1"/>
<plugin name="cordova-plugin-device" spec="~1.1.5"/>
<plugin name="cordova-plugin-statusbar" spec="~2.2.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.2"/>
<plugin name="cordova-plugin-file" spec="~6.0.0"/>
<plugin name="cordova-plugin-zip" spec="~3.1.0"/>
<plugin name="cordova-plugin-app-version" spec="~0.1.9"/>
<plugin name="cordova-plugin-network-information" spec="~3.0.0"/>
<plugin name="cordova-plugin-save-image" spec="0.2.5"/>
<plugin name="cordova-plugin-customurlscheme" spec="https://github.com/EddyVerbruggen/Custom-URL-scheme.git">
<variable name="URL_SCHEME" value="my.package.name" />
</plugin>
<plugin name="cordova-plugin-intent" spec="https://github.com/napolitano/cordova-plugin-intent.git" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<preference name="Fullscreen" value="true" />
<preference name="StatusBarOverlaysWebView" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="SplashScreenBackgroundColor" value="white"/>
<preference name="android-minSdkVersion" value="21"/>
<preference name="android-targetSdkVersion" value="30"/>
<preference name="Orientation" value="landscape"/>
<access origin="*"/>
<allow-navigation href="http://localhost:8080/*"/>
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine"/>
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<application android:allowBackup="false"/>
</edit-config>
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<application android:fullBackupContent="false"/>
</edit-config>
<edit-config file="AndroidManifest.xml" target="/manifest/application" mode="merge">
<application android:largeHeap="true" />
</edit-config>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<preference name="AndroidLaunchMode" value="singleTask"/>
<allow-intent href="market:*"/>
<intent-filter>
<action name="android.intent.action.SEND"/>
<action name="android.intent.action.SEND_MULTIPLE"/>
<category name="android.intent.category.DEFAULT"/>
<data mimeType="*/*"/>
</intent-filter>
<intent-filter label="@string/launcher_name">
<action name="android.intent.action.MAIN" />
<category name="android.intent.category.LAUNCHER" />
</intent-filter>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>
<engine name="ios" spec="~5.1.1"/>
<engine name="android" spec="~10.0.0"/>
</widget>