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
NativeScript 8.2 - Android 11+ file handle 'content://' #9871
Comments
|
@Siergiej29 you can try this fix by setting your package.json to this: Then be sure to run Please let us know if it works for you and upon confirmation we will publish the patch. |
|
Thank you for your time. After updating Ofc project was cleaned. Updated in reproduction: https://gitlab.com/NiepozornyJanusz/ns-file-android11 Example code: data.files.forEach(selected => {
let applicationContext = getNativeApplication().getApplicationContext();
const getOrSetHelper: org.nativescript.widgets.FileHelper = org.nativescript.widgets.FileHelper.fromString(applicationContext, selected);
console.log('##################');
console.log('applicationContext', applicationContext);
console.log('selected: ', selected);
console.log('getOrSetHelper: ', getOrSetHelper);
console.log('##################');
const fileRead = getFileAccess().read(selected)
console.log('### fileRead: ', fileRead);
const readSync = getFileAccess().readSync(selected)
console.log('### fileSync: ', readSync);
const readText = getFileAccess().readText(selected);
console.log('### fileReadText: ', readText);
getFileAccess().readAsync(selected).then(
readAsyncResolve => {
console.log('### fileAsyncResolve: ', readAsyncResolve)},
readAsyncRejected => {
console.log('### fileAsyncRejected: ', readAsyncRejected)}
);
});Selecting direct from downloadedPNG, JPG:PDF, DOCXJPEG, XLSX, CSVI wonder why there is a content to the file (PNG, JPG, PDF, DOCX) Select from external storageAfter selecting a file from another location (not direct downloaded) from external storage, I can read the graphic file JPEG, JPG, PNGOther files (PDF, DOCX, CSV, TXT) like bellow:In all files extensions from external storage I have getOrSetHelper (is not null) |
|
In this pull request return the path of the file that is necessary for openFile() and the background-http plugin and it works with android 11 |
|
Hi!, Can this problem be expected to be resolved? |
Issue Description
I am in the process of creating dynamic forms with the possibility of sending files of various types, recognized by their extension.
I use the ui-document-picker plugin for this (or whatever else plugin may be).
Unable to read content from
content: //According to the information at Nativescript Blog
It should be possible to read the contents of the file from
content: //, but it is not possible because it returns an error:error:
at FileSystemAccess29.readSync (file: src \ webpack: \ ns-file-android11 \ node_modules \ @nativescript \ core \ file-system \ file-system-access.android.js: 692: 0)points to file-system-access.android - 815
where
getOrSetHelperreturnsnulland therefore we cannot read the contents of the file.Does Nativescirpt 8.2 really have the correct file handling for android 11?
This is probably not a plug-in problem, just core NS itself.
Reproduction
I have created a sample repository with the problem already in place
https://gitlab.com/NiepozornyJanusz/ns-file-android11
example selected file uri:
content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Fdom-opole.jpgRelevant log output (if applicable)
No response
Environment
√ Component nativescript has 8.2.3 version and is up to date.
√ Component @nativescript/core has 8.2.2 version and is up to date.
× Component @nativescript/ios is not installed.
√ Component @nativescript/android has 8.2.2 version and is up to date.
Please accept these terms
The text was updated successfully, but these errors were encountered: