You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/07/30 07:35:01 UTC
[GitHub] [cordova-plugin-file] peterfox1 opened a new issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
peterfox1 opened a new issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408
# Bug Report
## Problem
### What is expected to happen?
`fileSystem.root.getFile` Should trigger the success callback.
### What does actually happen?
On Android 10, it triggers the error callback with `FileErrorĀ {code: 9}` (INVALID_MODIFICATION_ERR).
On Android 9 it works as expected - the success callback is triggered.
## Information
<!-- Include all relevant information that might help understand and reproduce the problem -->
Issue replicated with a physical Pixel 2 & the Pixel 2 emulator from android studio.
I wasn't getting the issue with android@8.0.0 / API 28, it's just been introduced when switching to android@9.0.0 / API 29.
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
Minimal example:
```
requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem) { // FS loaded
fileSystem.root.getFile("test.txt", {create: true, exclusive: false},
function(fileEntry) { // File loaded/created
fileEntry.createWriter(
function(writer) { // Writer created
writer.write('hello');
console.log('It worked!');
},
function(error) { // Writer failure
console.log('createWriter', error);
}
);
},
function(error) { // File failure
console.log('getFile', error); // !!! This gets triggered on Android 10 !!! //
}
);
},
function(error) { // FS Failure
console.log('requestFileSystem', error);
}
);
```
Output:
`getFile FileErrorĀ {code: 9}`
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
Android 10.0 / Pixel 2 API 29 emulator
Also replicated on a real Pixel 2 / Android 10.
Works correctly on Android 9 / Samsung S8.
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
Cordova
9.0.0 (cordova-lib@9.0.1)
Platform
android@9.0.0
Android 10.0 / Pixel 2 API 29 emulator
Android Studio 4.0.1
Windows 10.
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] peterfox1 edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
peterfox1 edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-666302030
Gave it a go saving to another location to see if it would get around that permission, seems like saving to the app data directory `cordova.file.dataDirectory` works.
`fileSystem.root` seems to be outside of the app data perhaps? - I didn't realise this since the docs say "fs.root is a DirectoryEntry object that represents the persistent storage in the sandboxed file system."
Also noticed:
- If the file was created by the API 28 app, the API 29 app seems to be able to write to it, it just can't create new files.
- Using `requestFileSystem(window.TEMPORARY` seems to work.
In case it's useful for anyone else that only needs to store files in the app dir, the change to use `cordova.file.dataDirectory` is:
```js
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, // <-----------
function (dirEntry) { // <-----------
dirEntry.getFile("test2.txt", {create: true, exclusive: false}, // <-----------
function(fileEntry) { // File loaded/created
fileEntry.createWriter(
function(writer) { // Writer created
writer.write('hello');
console.log('test2 it worked!');
},
function(error) { // Writer failure
console.log('createWriter', error);
}
);
},
function(error) { // File failure
console.log('getFile', error);
}
);
},
function(error) { console.log('resolveLocalFileSystemURL', error); }
);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-665853729
Definitely sounds like an API 29 restriction/change. Does it work on `cordova-android@9` when targeting API 28?
Try setting the `android-targetSdkVersion` preference to `28`. If it works, i think this will prove that there was no code change that caused the problem, just simply the target API upgrade.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-668820394
fix added inside this PR https://github.com/apache/cordova-plugin-file/pull/410
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek closed issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek closed issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-668352252
setting "android-targetSdkVersion" to 28 is only a temporary solution.
from August 2020 android will allow new apps only with "android-targetSdkVersion=29" and existing apps from November.
is someone working on a solution for it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan (_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
My AndroidManifest file added code in the application tag:
`<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" android:requestLegacyExternalStorage="true" android:usesCleartextTraffic="true">`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] evilcoder04 commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
evilcoder04 commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-676320541
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
It magically worked. Thank you everyone!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691469402
> hi,
>
> is there any news with the version? we still get the modification error.
> when you are going to insert the PR?
The provided PR is currently in a broken state: see https://github.com/apache/cordova-plugin-file/pull/410#issuecomment-671354675
> I am also facing this issue. now is there actually some upcoming fix for this?
as I understand, the mentioned fixes are just workarounds to enable some legacy mode.
The `requestLegacyExternalStorage` flag will be a stopgap measure to make existing code in API 29. It will probably break again in future API versions, we'll need investigate and find out what is involved in using the new file storage system, which will likely be a breaking change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-665853729
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] LuanHimmlisch commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
LuanHimmlisch commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-1080480190
@breautek I'm experiencing the same problem. I'm trying to write to `file:///storage/emulated/0/Download/`, which in theory should be an allowed path
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] peterfox1 edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
peterfox1 edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-666302030
Gave it a go saving to another location to see if it would get around that permission, seems like saving to the app data directory `cordova.file.dataDirectory` works.
`fileSystem.root` seems to be outside of the app data perhaps? - I didn't realise this since the docs say "fs.root is a DirectoryEntry object that represents the persistent storage in the sandboxed file system."
Also noticed the following when trying out some options:
- If the file was created by the API 28 app, the API 29 app seems to be able to write to it, it just can't create new files.
- Using `requestFileSystem(window.TEMPORARY` seems to work.
In case it's useful for anyone else that only needs to store files in the app dir, the change to use `cordova.file.dataDirectory` is:
```js
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, // <-----------
function (dirEntry) { // <-----------
dirEntry.getFile("test2.txt", {create: true, exclusive: false}, // <-----------
function(fileEntry) { // File loaded/created
fileEntry.createWriter(
function(writer) { // Writer created
writer.write('hello');
console.log('test2 it worked!');
},
function(error) { // Writer failure
console.log('createWriter', error);
}
);
},
function(error) { // File failure
console.log('getFile', error);
}
);
},
function(error) { console.log('resolveLocalFileSystemURL', error); }
);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-722242096
Oh nice, I'm glad u already solved it! I'm from the Philippines @Rei66RM - yeah! you already targetted the android API 29 0 `<preference name="android-targetSdkVersion" value="29" />` nice! and about the docs in Cordova I guess they always have the latest update news in their blog post [here](https://cordova.apache.org/blog/) then some of their updates the code & docs and some of its code only. Based on my side, I always refer to the GitHub reported issues discussion thread in either plugins or platforms if I had a problem in my build. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] HansKrywaa commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
HansKrywaa commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670448061
@rastafan But it would have worked if you removed your Config, so i think it is ready to merge
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] rastafan commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
rastafan commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670379873
I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
Just to add some details, we had this line in our config.xml:
```
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
```
Installing @eliadAfeka 's fork gave us this error:
```
Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
```
So we edited our config.xml to look like this:
```
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
</edit-config>
```
and the problem seems to be solved.
Thanks everyone for your help.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan(_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
My AndroidManifest file looks like this:
`<?xml version='1.0' encoding='utf-8'?>
<manifest ... >
<supports-screens ... />
<uses-permission ... />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true" android:usesCleartextTraffic="true">
<activity ... >
<intent-filter ... >
<action ... />
<category ... />
</intent-filter>
</activity>
<provider .... /></provider>
</application>
<uses-permission ... />
<uses-permission ... />
<uses-permission ... />
<uses-permission ... />
</manifest>`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] peterfox1 commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
peterfox1 commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-665857868
Yeah I think you're right, that worked with `cordova-android@9` and `android-targetSdkVersion` set to 28.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] yemitula commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
yemitula commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-1062934887
Hi everyone. It's 2022 and I'm having this issue again.
android-targetSdkVersion: 30 (Play Store Requirements)
Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.1
`
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" />
</edit-config>
`
Already added to config.xml
Error Code 9 still coming up. Has anything changed about this for SDK 30?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-669630228
@hariagustian can you install the PR https://github.com/apache/cordova-plugin-file/pull/410 and let us know if the PR solves your issue when targeting API 29?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] steamoshza commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
steamoshza commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-690804216
I am also facing this issue. now is there actually some upcoming fix for this?
as I understand, the mentioned fixes are just workarounds to enable some legacy mode.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691469402
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] wikz commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
wikz commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-744479728
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
worked seamlessly
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-1062949954
`android:requestLegacyExternalStorage` is forcefully off on API 30. That flag was only used on API 29 to revert to previous behaviour to give you time to do any necessary migrations before API 30.
I believe an invalid modification error on API 30 generally occurs when you're attempting to write to an external storage path that is no longer writable, or that your app doesn't have permission to write to (such as modifying a file that wasn't created by your app).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] hariagustian commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
hariagustian commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-669629731
Hi, i also had this issue,
My error is, code 12 PATH_EXISTS_ERR
when i try to create a folder
global.resolveLocalFileSystemURL( cordova.file.externalRootDirectory, function (dirEntry) {
dirEntry.getDirectory('KMSBalita', { create: true }, function (subDirEntry) {
....
},
function( error ){
console.log( error )
})
})
now i solve this by change target api to 28 instead of 29 but only temporary
Mostly error from android 10.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] apolunderblade edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
apolunderblade edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-686346702
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan(_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
My AndroidManifest file looks like this:
`<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="#" android:versionName="#.###.##" package="com.projectName.projectName" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.fileOpener2.provider" android:exported="false" android:grantUriPermissions="true" android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" />
</provider>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-667091092
That's interesting... `fs.root` appears to return a directory that looks something like: `file:///data/user/0/<app-id>/files/files/` and that should still work I think. `/data/user/0/<app-id>` I believe is a symlink to `/data/data/<app-id>/`.
When I use the `dataDirectory` method like yours, then the file path becomes: `file:///data/user/0/<app-id>/files/`
Perhaps `files/files/` is not created yet?
I tested the original code that produced the error for you on my android 10 device and it worked for me, but my app ensures that `files/files/` directory is created (cause that is where we actually store our files).
This is starting to look less like a scoped storage issue and more like something is just not being initialised properly issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691433497
hi,
is there any news with the version? we still get the modification error.
when you are going to insert the PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo removed a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo removed a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670454099
So we edited our config.xml to look like this:
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
</edit-config>
and the problem seems to be solved.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691433497
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] evilcoder04 commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
evilcoder04 commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-686341553
@apolunderblade I think you need to update your Cordova CLI to version 10.0.0 and your Cordova Android to 9.0.0 before you can add the `requestLegacyExternalStorage` flag.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-668580149
> setting "android-targetSdkVersion" to 28 is only a temporary solution.
> from August 2020 android will allow new apps only with "android-targetSdkVersion=29" and existing apps from November.
> is someone working on a solution for it?
I have only briefly looked at this issue, but my time is rather limited. PRs are definitely welcome and appreciated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-667091092
That's interesting... `fs.root` appears to return a directory that looks something like: `file:///data/user/0/<app-id>/files/files/` and that should still work I think. `/data/user/0/<app-id>` I believe is a symlink to `/data/data/<app-id>/`.
When I use the `dataDirectory` method like yours, then the file path becomes: `file:///data/user/0/<app-id>/files/`
Perhaps `files/files/` is not created yet?
I tested the original code that produced the error for you on my android 10 device and it worked for me, but my app ensures that `files/files/` directory is created (cause that is where we actually store our files).
This is starting to look less like a scoped storage issue and more like something is just not being initialised properly issue.
Edit: Just tried it on a cordova hello world template app and it still worked on my android 10 device, API target 29 apk :confused:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] peterfox1 commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
peterfox1 commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-666302030
Gave it a go saving to another location to see if it would get around that permission, seems like saving to the app data directory `cordova.file.dataDirectory` works.
`fileSystem.root` seems to be outside of the app data perhaps? - I didn't realise this since the docs say "fs.root is a DirectoryEntry object that represents the persistent storage in the sandboxed file system."
Also noticed:
- If the file was created by the API 28 app, the API 29 app seems to be able to write to it, it just can't create new files.
In case it's useful for anyone else that only needs to store files in the app dir, the change to use `cordova.file.dataDirectory` is:
```js
window.resolveLocalFileSystemURL(cordova.file.dataDirectory, // <-----------
function (dirEntry) { // <-----------
dirEntry.getFile("test2.txt", {create: true, exclusive: false}, // <-----------
function(fileEntry) { // File loaded/created
fileEntry.createWriter(
function(writer) { // Writer created
writer.write('hello');
console.log('test2 it worked!');
},
function(error) { // Writer failure
console.log('createWriter', error);
}
);
},
function(error) { // File failure
console.log('getFile', error);
}
);
},
function(error) { console.log('resolveLocalFileSystemURL', error); }
);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] LuanHimmlisch commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
LuanHimmlisch commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-1080856002
If anyone has this problem
```xml
<edit-config file="app/src/main/AndroidManifest.xml" target="application" mode="merge">
<application android:requestLegacyExternalStorage="true" />
</edit-config>
```
Still works when targeting android-30. Just be sure to have `xmlns:android="http://schemas.android.com/apk/res/android"` on the widget tag
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670454099
So we edited our config.xml to look like this:
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
</edit-config>
and the problem seems to be solved.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] breautek commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-668829711
Thank you @eliadAfeka
@peterfox1 since i failed to reproduce the issue last time I looked at this, could you test the PR to see if it resolves it for you?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] apolunderblade commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
apolunderblade commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-686338920
Hi I'm having this problem when trying to add the android:requestLegacyExternalStorage
Can anyone help me how to fix this exactly?
Here is the error:
"AAPT: error: attribute android:requestLegacyExternalStorage not found."
I already update my SDK idk what to do anymore. TIA
Ionic Info:
Ionic CLI : 5.4.16
Ionic Framework : @ionic/angular 4.11.2
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 23 other plugins)
Utility:
cordova-res : not installed
native-run (update available: 1.0.0) : 0.3.0
System:
NodeJS : v12.16.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.4
OS : Windows 10
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan (_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
AndroidManifest file added code in the application tag:
`<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" android:requestLegacyExternalStorage="true" android:usesCleartextTraffic="true">`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] Rei66RM commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
Rei66RM commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-721554954
> Hi @Rei66RM, can your provide your code in config.xml file (loc: /config.xml) & the AndroidManifest.xml file located in - /plaforms/android/app/src/main/AndroidManifest.xml to examine the diff of my existing cordova app. Thanks!
HI Pepenero, Are you Italian?
However it seems that I have solved it. Reading the various comments in the post, I have updated cordova and CLI, and now access to the filesystem is ok, also I have installed the plugin to check permissions and am still working to develop an effective file access strategy (mine app makes extensive use of it). I struggle to find valid documentation about managing files in cordova, indeed if anyone knows any efficient plugin, or documentation, if they can post it I would be very grateful. Greetings from Italy!
This is my section from config.xml
` <preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="SplashScreen" value="none" />
<preference name="loadUrlTimeoutValue" value="100000" />
<plugin name="cordova-plugin-android-fingerprint-auth" spec="^1.5.0" />
<plugin name="cordova-plugin-app-version" spec="~0.1.8" />
<plugin name="cordova-plugin-camera" spec="^2.4.1" />
<plugin name="cordova-plugin-device" spec="~1.1.1" />
<plugin name="cordova-plugin-device-orientation" spec="~1.0.2" />
<plugin name="cordova-plugin-dialogs" spec="~1.2.0" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-file-opener2" spec="~2.0.2" />
<plugin name="cordova-plugin-email-composer" spec="~0.8.15" />
<plugin name="cordova-plugin-geolocation" spec="^2.4.3" />
<plugin name="cordova-plugin-globalization" spec="~1.0.3" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.3.0" />
<plugin name="cordova-plugin-media-capture" spec="^3.0.2" />
<plugin name="cordova-plugin-network-information" spec="~1.2.0" />
<plugin name="cordova-plugin-speechrecognition" spec="^1.1.2" />
<plugin name="cordova-plugin-statusbar" spec="~2.1.2" />
<plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
<plugin name="cordova.plugins.diagnostic" spec="~3.5.0" />
<plugin name="org.apache.cordova.plugin.cache" spec="https://github.com/tiltshiftfocus/cordova-plugin-cache.git" />
<plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git" />`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan (_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
My AndroidManifest file looks like this:
`<?xml version='1.0' encoding='utf-8'?><manifest ... >supports-screens ... />
<uses-permission ... />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true" android:usesCleartextTraffic="true">
</manifest>`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-669320027
@breautek - to reproduce it you must have an Android 10 and set sdk version to 29. uninstall your app, build and run.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-668723879
@breautek - I will try to see if I can fork a solution.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] akshaymethaniya commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
akshaymethaniya commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-781951869
Can anyone help me?
I am getting **NO_MODIFICATION_ALLOWED** error when i try to remove any file using ionic File plugin's remove method.
Note : I am passing correct dirPath and filename
code :
await this.fileCtrl.removeFile(dirPath,filename).then((res) =>{
alert('successfully deleted' + filename)
},(err) =>{
alert(JSON.stringify(err))
});
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] apolunderblade commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
apolunderblade commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-686346702
> @apolunderblade I think you need to update your Cordova CLI to version 10.0.0 and your Cordova Android to 9.0.0 before you can add the `requestLegacyExternalStorage` flag.
I see let me try! Thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] HansKrywaa commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
HansKrywaa commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-669761605
The ImagePicker Plugin has a similar Problem and it was solved with the [same Fix](https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/208).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691433497
hi,
is there any news with the version? we still get the modification error.
when you are going to insert the PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] eliadAfeka commented on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
eliadAfeka commented on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-691433497
hi,
is there any news with the version? we still get the modification error.
when you are going to insert the PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-file] pepenemo edited a comment on issue #408: Platform android@9.0.0 running on Android 10 : getFile produces INVALID_MODIFICATION_ERR - Error code 9.
Posted by GitBox <gi...@apache.org>.
pepenemo edited a comment on issue #408:
URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem.
> I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml.
>
> Just to add some details, we had this line in our config.xml:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" />
> </edit-config>
> ```
>
> Installing @eliadAfeka 's fork gave us this error:
>
> ```
> Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.
> ```
>
> So we edited our config.xml to look like this:
>
> ```
> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
> <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/>
> </edit-config>
> ```
>
> and the problem seems to be solved.
>
> Thanks everyone for your help.
I had the same issue and it was fixed of the comment added by @rastafan(_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml
My AndroidManifest file looks like this:
`<?xml version='1.0' encoding='utf-8'?>
<manifest ... >
<supports-screens ... />
<uses-permission ... />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" **android:requestLegacyExternalStorage="true"** android:supportsRtl="true" **android:usesCleartextTraffic="true"**>
<activity ... >
<intent-filter ... >
<action ... />
<category ... />
</intent-filter>
</activity>
<provider .... /></provider>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>`
and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22.
Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org