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 [email protected] / API 28, it's just been 
introduced when switching to [email protected] / 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 ([email protected])
   
   Platform
   [email protected]
   
   
   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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to