for anyone facing this issue:
In yuor project navigate to the URL the error is giving, in my case:
platforms\android\app\src\main\java\org\apache\cordova\filetransfer\FileTransfer.java
1. In the imports replace 'Whitelist' with 'Allowlist'
example:
import org.apache.cordova.Whitelist; => import org.apache.cordova.AllowList;
2. around line 690 replace 'Whitelist' with 'Allowlist' inside de conditional:
Boolean shouldAllowRequest = null;
if (isLocalTransfer) {
shouldAllowRequest = true;
}
if (shouldAllowRequest == null) {
try {
Method gwl = webView.getClass().getMethod("getWhitelist");
'Whitelist' whitelist = ('Whitelist')gwl.invoke(webView);
shouldAllowRequest = whitelist.isUrl'WhiteListed'(source);
} catch (NoSuchMethodException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
}
Example:
old:
try {
Method gwl = webView.getClass().getMethod("getWhitelist");
Whitelist whitelist = (Whitelist)gwl.invoke(webView);
shouldAllowRequest = whitelist.isUrlWhiteListed(source);
} catch (NoSuchMethodException e) {....
new:
try {
Method gwl = webView.getClass().getMethod("getWhitelist");
AllowList whitelist = (AllowList)gwl.invoke(webView);
shouldAllowRequest = whitelist.isUrlAllowListed(source);
} catch (NoSuchMethodException e) {.....
plugin repository:
https: