Home > front end >  android 10 doesn't support whitelist plugin
android 10 doesn't support whitelist plugin

Time:09-17

Android 10 doesn't support "whitelist plugin", when I add android platform it skips whitelist plugin which cause "file transfer plugin" issues when building or running the application

ionic cordova platform add android@latest

Installing "cordova-plugin-whitelist" for android
Plugin doesn't support this project's cordova-android version. cordova-    android: 10.1.0, failed version requirement: >=4.0.0 <10.0.0
Skipping 'cordova-plugin-whitelist' for android

When creating the application, these errors will appear :

ionic cordova build android

Task :app:compileDebugJavaWithJavac D:\workspace\SCL\platforms\android\app\src\main\java\org\apache\cordova\filetransfer\FileTransfer.java:48: error: cannot find symbol import org.apache.cordova.Whitelist; ^ symbol: class Whitelist location: package org.apache.cordova D:\workspace\SCL\platforms\android\app\src\main\java\org\apache\cordova\filetransfer\FileTransfer.java:691: error: cannot find symbol Whitelist whitelist = (Whitelist)gwl.invoke(webView); ^ symbol: class Whitelist location: class org.apache.cordova.filetransfer.FileTransfer D:\workspace\SCL\platforms\android\app\src\main\java\org\apache\cordova\filetransfer\FileTransfer.java:691: error: cannot find symbol Whitelist whitelist = (Whitelist)gwl.invoke(webView); ^ symbol: class Whitelist location: class org.apache.cordova.filetransfer.FileTransfer Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors

it seems like "file transfer" require "whitelist plugin" but "whitelist plugin" is being skipped when adding android > 10

this doesn't happen in android 9

anyone can help please ?

CodePudding user response:

I think you have the same problem i had to sorted out.

Go to your Cordova Folder path and edit the package.json file removing the two lines that references cordova-plugin-whitelist.

And all will be perfect after that.

CodePudding user response:

cordova version 10.0.0 or later does not need cordova-plugin-whitelist plugin you can just simply remove them . cordova 10.0.0 or android 10.0.0 (API 30) have inbuild core whitelist so you can remove and make build again

  • Related