ASHBAW opened a new issue #436:
URL: https://github.com/apache/cordova-plugin-file/issues/436


   # Bug Report
   Issue when reading text file from Android Download folder with Android 11
   
   ## Problem
   I have an Ionic 5 app that uses this plugin to read text files from the 
Download folder on Android devices. On devices running Android 11 it does not 
work. Devices running Android 9 do work - have not tried on Android 10.
   
   ### What is expected to happen?
   App should be able to read in text file from Android's Download folder
   
   ### What does actually happen?
   The promise for readAsText() returns null
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   Run on devices with Android 11
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   Ionic app is using @ionic-native/file/ngx as a wrapper for the 
cordova-plugin-file plugin.
   
   ```
   const path = this.file.externalRootDirectory + 'Download';
   
   this.file.readAsText(path, 'foo.txt').then((file) => {
      console.log('process file');   
   }).catch((e) => {
     console.log('error '+ e); 
   });
   ```
   Again this works for Android 9 devices (have not been able to try on a 
Android 10 device) but not 11.
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   Ionic 5 with the following configuration
   ```
      Ionic CLI                     : 6.12.2 
(/Users/.nvm/versions/node/v12.18.3/lib/node_modules/@ionic/cli)
      Ionic Framework               : @ionic/angular 5.4.3
      @angular-devkit/build-angular : 0.1002.0
      @angular-devkit/schematics    : 10.1.7
      @angular/cli                  : 10.2.0
      @ionic/angular-toolkit        : 2.3.3
   
   Cordova:
   
      Cordova CLI       : 10.0.0
      Cordova Platforms : android 9.0.0, ios 6.1.1
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, 
cordova-plugin-ionic-webview 5.0.0, (and 15 other plugins)
   
   Utility:
   
      cordova-res (update available: 0.15.2) : 0.15.1
      native-run (update available: 1.2.2)   : 1.0.0
   
   System:
   
      ios-sim : 8.0.2
      NodeJS  : v12.18.3 (/Users/.nvm/versions/node/v12.18.3/bin/node)
      npm     : 6.14.8
      OS      : macOS Catalina
      Xcode   : Xcode 12.2 Build version 12B45b
   ```
   ### Version information
   Using     "cordova-plugin-file": "^6.0.2"
   
   ## 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