Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android picker returns null if a file is selected from Recent section #13

Open
shiv19 opened this issue Sep 24, 2021 · 9 comments
Open

Comments

@shiv19
Copy link

shiv19 commented Sep 24, 2021

image
If I select the XML file from the Recent section then I get back null,

JS: {
JS:   "files": [
JS:     null
JS:   ],
JS:   "android": {}
JS: }

However, if I open the menu and go into the internal storage, downloads and then select the file, I get the correct path

JS: {
JS:   "files": [
JS:     "/storage/emulated/0/Download/NectronGoldenAle.xml"
JS:   ],
JS:   "android": {}
JS: }
@farfromrefug
Copy link
Member

@shiv19 that seem native related. Did you try on real device?

@shiv19
Copy link
Author

shiv19 commented Sep 24, 2021

@farfromrefug yes, these screenshots are from a real device. It was connected to my laptop via USB debugging mode.

@shiv19
Copy link
Author

shiv19 commented Sep 24, 2021

The target SDK is 30.

@ShimonKh
Copy link

I'm also having the same problem, does anyone have a solution?

@dfborba
Copy link

dfborba commented Oct 19, 2021

Same here. Seems that the error is not only related to recent section, because it had occasions which I was able to navigate to a folder and back to recent section and I was able to pick file. In other times it return null from Download section.

@farfromrefug
Copy link
Member

@dfborba @ShimonKh sorry i dont have much time to look at this right now. The best thing would be to make a quick search on the web to see if it happens with native. We could find a solution on stackoverflow.

@dfborba
Copy link

dfborba commented Oct 19, 2021

@farfromrefug Don't worry, I definitely understand :). The solutions I've found didn't work for my case, but I'll keep searching!
If you have any EAT in the further future, please tell us, it would be great to have all in one place instead of a lot of logic outside the plugin.

@OPADA-Eng
Copy link

Same for me, any solution or workaround?

@xpalacincreditoh
Copy link

xpalacincreditoh commented Nov 26, 2021

I have the same error when select a PDF or doc file with Android 11 SDK 30.

And in my case when attempt to read file get error: Error: ReadTask returns no result.

const file = fileSystemModule.File.fromPath(results[0]);
                    console.log('file', file);
                    const name = file._name;
                    console.log('name', name);
                    let filebase64 = '';

                    file.read().then((value) => {
                        console.log('value', value);
                        if (isAndroid) filebase64 = android.util.Base64.encodeToString(value, android.util.Base64.NO_WRAP);
                        else filebase64 = value.base64EncodedStringWithOptions(0);
                        accept([
                            {
                                file: filebase64,
                                name: name,
                            },
                        ]);
                    }).catch(function (e) {
                        // process error
                        console.log('file.read error');
                        console.log(e);
                        reject('Algo ha fallado al subir la imagen desde la galería, inténtelo de nuevo.');
                    });

If i change to targetSdkVersion 29 works fine but to publish now to google app store need 30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants