Ionic3 cordova Base64 encodeFile not working in android 10

Base64 encoded file is working fine in another version but it is not working in android 10. I have used
this base64 package
It works when I work in the camera but not working when I tried to load a file from the gallery

Is there a specific reason you’re using that?

I need to encode the file in base64.It is working fine in lower android version and also works when i am using camera but it is not working when i tried to load a file from gallery.

There are a million ways to encode things in base64, and it’s difficult to know what exactly you mean by “the file”. I asked if there is a specific reason you’re using that particular plugin, because I would not bother to rely on a plugin to do base64.

Yes, I had also tried to read the file using file reader.It returns empty.I tried to upload file using file choose package.In android 10 file chooser return url like “content://” which includes % sign so it is not working where as other android version return url like content //

just do this encodeURI(url)

it is still not working not working

I have also tried using file reader.It is not working.Here is my code =>{
let loading = this.loadingCtrl.create({
this.filePath.resolveNativePath(uri).then(filePath =>
this.file.resolveLocalFilesystemUrl(filePath).then(fileInfo =>
let files = fileInfo as FileEntry;
if (removeFile) { = ;
files.file((file) => {
var reader = new FileReader();
reader.onloadend = (e :any) => {
let result =; // text content of the file
// check file loaded