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 2021/09/16 21:18:47 UTC

[GitHub] [cordova-plugin-file] janetcasarez opened a new issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

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


   # Bug Report
   Cannot read files under cordova.file.externalRootDirectory for Android 11
   
   ## Problem
   Getting ready for move to Android 11 and new folder locations. I need to move my app user files from old location into new location. 
   My old location for user files is  cordova.file.externalRootDirectory/crossstitch. 
   New location will be  cordova.file.externalRootDirectory/Android/data/com.crochetdesigns.crossstitch/. 
   However,  when I set <preference name="AndroidPersistentFileLocation" value="Compatibility" />and <preference name="AndroidPersistentFileLocation" value="Compatibility" /> in config.xml,  I can not read the files under old folder to move them. I assume the change deadline is still Nov 1 2021. Then all apps need to target 30.
   
   If I do an update now and leave it targeted to 29 all is good. But that does not leave users enough time to update the app, use the app to get files moved before Nov 1 deadline. I have been trying to solve this problem for over a month now.  I have 11 apps in the playstore that I will need to do this for.
   
   ### What is expected to happen?
   Allow apps targeted for 30 to read all files under cordova.file.externalRootDirectory.
   
   
   ### What does actually happen?
   can only read my .png files  under cordova.file.externalRootDirectory/crosssstitch folder
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   Test code below:
   
   var movePatFiles = {
   
    movePatFiles: function () {
           // old location of files      
           try {
               window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, movePatFiles.feMovePattFiles, movePatFiles.moveFail);
   
           }
           catch (error) {
               alert(error);
           }
       },
   
   feMovePattFiles: function (fileSystem) {
           // folder already exists
           try {
               fileSystem.root.getDirectory("crossstitch", { create: true, exclusive: false }, movePatFiles.feMovePatternFiles, movePatFiles.moveFail);
           }
           catch (error) {
               alert(error);
           }
       },
   feMovePatternFiles: function (directoryEntry) {
   
           // read from cordova.file.externalRootDirectory + "crossstitch" + "/"
           // read all the files in the folder
           var reader = directoryEntry.createReader();
           reader.readEntries(movePatFiles.getPatFileList, movePatFiles.moveFail);
       },
   
    getPatFileList: function (entries) {
           var patFiles = [];
           for (var i = 0; i < entries.length; i++) {
               
               // only finds my .png files
                alert (entries[i].name);
               
           }
           return patFiles;
       },
     moveFail: function (error) {
           alert("fail");
           
       }
   }
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   Android 11 only. <preference name="android-targetSdkVersion" value="30" />
   
   
   ### 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 version 10.0.0
   cordova-plugin-file 6.0.2 "File"
   
   
   
   ## 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.

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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-923977931


   Thanks I appreciate that.
     
    Janet
     
     
     
   
   ----------------------------------------
    From: "Norman Breau" ***@***.***>
   Sent: Monday, September 20, 2021 7:31 PM
   To: "apache/cordova-plugin-file" ***@***.***>
   Cc: "janetcasarez" ***@***.***>, "Author" ***@***.***>
   Subject: Re: [apache/cordova-plugin-file] Cannot read files undercordova.file.externalRootDirectory for Android 11 (#494)   
   
       
   
   I guess I should also mention. using preference name="android-targetSdkVersion" value="29"
   works fine. The problem shows up when set to 30.   
   
   I'll retry my test app against API 30, it's possible that I'm recalling memory while testing API 29 to see if I reproduce the same issue.  
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.  
   
   


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-926856284


   cordova plugin add https://github.com/breautek/cordova-plugin-file.git#feat/api30
   
   Failed to fetch plugin https://github.com/breautek/cordova-plugin-file.git#feat/api30 via registry.
   Probably this is either a connection problem, or plugin spec is incorrect.
   Check your connection and plugin name/version/URL.
   CordovaError: Error: npm: Command failed with exit code 1 Error output:
   npm ERR! code ENOENT
   npm ERR! syscall spawn git
   npm ERR! path git
   npm ERR! errno ENOENT
   npm ERR! enoent Error while executing:
   npm ERR! enoent undefined ls-remote -h -t https://github.com/breautek/cordova-plugin-file.git
   npm ERR! enoent
   npm ERR! enoent
   npm ERR! enoent spawn git ENOENT
   npm ERR! enoent This is related to npm not being able to find a file.
   npm ERR! enoent
   
   log file below
   0 info it worked if it ends with ok
   1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
   1 verbose cli   'C:\\Users\\Janet\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
   1 verbose cli   'install',
   1 verbose cli   'https://github.com/breautek/cordova-plugin-file.git#feat/api30',
   1 verbose cli   '--save-dev' ]
   2 info using npm@6.14.11
   3 info using node@v10.18.0
   4 verbose npm-session 0c4216be30d3a5ca
   5 silly install loadCurrentTree
   6 silly install readLocalPackageData
   7 silly fetchPackageMetaData error for git+https://github.com/breautek/cordova-plugin-file.git#feat/api30 Error while executing:
   7 silly fetchPackageMetaData undefined ls-remote -h -t https://github.com/breautek/cordova-plugin-file.git
   7 silly fetchPackageMetaData
   7 silly fetchPackageMetaData
   7 silly fetchPackageMetaData spawn git ENOENT
   8 timing stage:rollbackFailedOptional Completed in 0ms
   9 timing stage:runTopLevelLifecycles Completed in 577ms
   10 verbose stack Error: spawn git ENOENT
   10 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
   10 verbose stack     at onErrorNT (internal/child_process.js:415:16)
   10 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
   11 verbose cwd D:\AAmyStuff\ABlackStitchCreator\BlackStitchCreator
   12 verbose Windows_NT 10.0.19042
   13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Janet\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/breautek/cordova-plugin-file.git#feat/api30" "--save-dev"
   14 verbose node v10.18.0
   15 verbose npm  v6.14.11
   16 error code ENOENT
   17 error syscall spawn git
   18 error path git
   19 error errno ENOENT
   20 error enoent Error while executing:
   20 error enoent undefined ls-remote -h -t https://github.com/breautek/cordova-plugin-file.git
   20 error enoent
   20 error enoent
   20 error enoent spawn git ENOENT
   21 error enoent This is related to npm not being able to find a file.
   22 verbose exit [ 1, true ]
   
   


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-928164922






-- 
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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-1070908825


   > Just a bystander reading some PRs here... but is this potentially fixed by #487 ? Anyone in a position to test whether this resolves the problem for them?
   
   Not sure if #487 will fix this issue because I couldn't test this specific issue. In API 30, it seems like the `externalRootDirectory` is no longer a writable 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] breautek commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-923432540


   > I guess I should also mention. using preference name="android-targetSdkVersion" value="29"
   > works fine. The problem shows up when set to 30.
   
   I'll retry my test app against API 30, it's possible that I'm recalling memory while testing API 29 to see if I reproduce the same 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.

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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-926027978


   FYI, noticed you're replying via email. I've edited my commented above which you probably didn't see unless if you actually clicked the link and viewed the comment on GitHub.


-- 
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] peitschie commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
peitschie commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-1070350692


   Just a bystander reading some PRs here... but is this potentially fixed by https://github.com/apache/cordova-plugin-file/pull/487 ? Anyone in a position to test whether this resolves the problem for them?


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-926624444


    Thanks. Didn't see it. Will get that a try.
    Janet
   
     
     
     
   
   ----------------------------------------
    From: "Norman Breau" ***@***.***>
   Sent: Thursday, September 23, 2021 1:50 PM
   To: "apache/cordova-plugin-file" ***@***.***>
   Cc: "janetcasarez" ***@***.***>, "Author" ***@***.***>
   Subject: Re: [apache/cordova-plugin-file] Cannot read files undercordova.file.externalRootDirectory for Android 11 (#494)   
   
      
   
   FYI, noticed you're replying via email. I've edited my commented above which you probably didn't see unless if you actually clicked the link and viewed the comment on GitHub.  
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.  
   
   


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-927372034


   Installed git. Installed plugin. cordova-plugin-file 7.0.0-dev "File"
   Will test soon.


-- 
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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-928030573


   Thanks.. I have two questions
   
   1. May I ask what creates/writes the `c2021827103827.cht` file? Is it your app? Is it an third-party app?
   2. What API are you using to get the `entries` list? Is it ```var reader = directoryEntry.createReader();
       reader.readEntries(movePatFiles.getPatFileList, movePatFiles.moveFail);```?


-- 
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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-1070908825


   > Just a bystander reading some PRs here... but is this potentially fixed by #487 ? Anyone in a position to test whether this resolves the problem for them?
   
   Not sure if #487 will fix this issue because I couldn't test this specific issue. In API 30, it seems like the `externalRootDirectory` is no longer a writable 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] ncomo11 commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
ncomo11 commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-939960203


   I found that this is due to recent release of "Scoped Storage" concept introduced in Android 10. Below is a portion of a session which may explain the behavior and also sharing session video of 'Preparing for scoped storage (Android Dev Summit '19)' for detail 👍 
   https://www.youtube.com/watch?v=UnJ3amzJM94
   
   
   04:55
   So in order to read any other type of file,
   04:58
   like a PDF or a document, apps now
   05:00
   need to use the system picker.
   05:03
   This is accessed using the Storage Access Framework.
   05:08
   Also, writing any files outside of the organized media
   05:11
   collections or your app directories
   05:13
   also requires using the system picker
   


-- 
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] ncomo11 commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
ncomo11 commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-938395163


   @janet i am able to see the attached manifest file. I am also facing the same issue only media files are visible not able to see any pdf files under Download folder.


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-929272783


   More info. Don't know if this helps:
   AndroidManifest file below:
   <?xml version='1.0' encoding='utf-8'?>
   <manifest android:hardwareAccelerated="true" android:versionCode="20203" android:versionName="2.2.3" package="com.crochetdesigns.blackstitchcreator" 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: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: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>
           <receiver android:enabled="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
               <intent-filter>
                   <action android:name="android.intent.action.SEND" />
               </intent-filter>
           </receiver>
           <provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
               <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
           </provider>
       </application>
       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
       <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   </manifest>
   ![Screenshot_20210928-091342_Permission controller](https://user-images.githubusercontent.com/90871039/135104936-ec0c8768-baff-452b-b07c-1a97e051a365.jpg)
   
   
   


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-928168101


   I guess I should also mention there is nothing special about the c2021827103827.cht. I also tested with a test.txt file. It could not read that file either
     
    Janet
     
     
     
   
   ----------------------------------------
    From: "Norman Breau" ***@***.***>
   Sent: Monday, September 27, 2021 12:08 PM
   To: "apache/cordova-plugin-file" ***@***.***>
   Cc: "janetcasarez" ***@***.***>, "Author" ***@***.***>
   Subject: Re: [apache/cordova-plugin-file] Cannot read files undercordova.file.externalRootDirectory for Android 11 (#494)   
   
      
   
   Thanks.. I have two questions   	May I ask what creates/writes the c2021827103827.cht file? Is it your app? Is it an third-party app? 	What API are you using to get the entries list? Is it var reader = directoryEntry.createReader(); reader.readEntries(movePatFiles.getPatFileList, movePatFiles.moveFail);? 
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.  
   
   


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-928164922


   1. My app creates the pattern file c2021827103827.cht 
    2. Yes. 
       var reader = directoryEntry.createReader();
     reader.readEntries(movePatFiles.getPatFileList30, movePatFiles.moveFail);
     
     
    Janet
     
     
   
   ----------------------------------------
    From: "Norman Breau" ***@***.***>
   Sent: Monday, September 27, 2021 12:08 PM
   To: "apache/cordova-plugin-file" ***@***.***>
   Cc: "janetcasarez" ***@***.***>, "Author" ***@***.***>
   Subject: Re: [apache/cordova-plugin-file] Cannot read files undercordova.file.externalRootDirectory for Android 11 (#494)   
   
      
   
   Thanks.. I have two questions   	May I ask what creates/writes the c2021827103827.cht file? Is it your app? Is it an third-party app? 	What API are you using to get the entries list? Is it var reader = directoryEntry.createReader(); reader.readEntries(movePatFiles.getPatFileList, movePatFiles.moveFail);? 
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.  
   
   


-- 
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] akshaymethaniya commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
akshaymethaniya commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-1079621254


   I am not able to read access android/data folder in android 11 devices. 
   I have application in production which is not working properly due to this on android 11 and 12. 
   Does this android 11 storage permission change are done for ionic file plugin? Can anyone confirm?


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-922026016


   I guess I should also mention. using <preference name="android-targetSdkVersion" value="29" /> 
   works fine. The problem shows up when set to 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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-921288899


   If you're app has the `READ_EXTERNAL_STORAGE` permission granted, in my testing reading from external storage works, however some APIs did not attempt to request permission. Reading directories was one of those methods. I have an open [PR](https://github.com/apache/cordova-plugin-file/pull/487) that corrects this specific issue, but not sure if that covers all cases for external storage. You can try applying that PR to see if it addresses your issue. Note that any app that has been prompted for external storage permissions but been previously denied may result in an automatic denial of the permission, in which case the user must navigate to the permission settings themselves to enable the permission.
   
   `READ_EXTERNAL_STORAGE` permission isn't always necessary for reading files in external storage, but it is necessary when reading files that doesn't belong to your app. I believe anything outside of your application's external data directory is considered not own by your app (with the exception of the predefined MediaStore containers, which has some special rules).


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-922016071


    
     Norman,
   
   Thanks for your quick reply.
     
    Sorry, I should have mentioned it before. I already check permission for READ_EXTERNAL_STORAGE.
     
    cordova-plugin-android-permissions 1.1.2
     
    Below is sample code:
     
    I get the alert "has permission". From what I understand READ_EXTERNAL_STORAGE is granted by default. You don't need to request it.  I still can only read the .png files and not my pattern files.
     
    testPermissions: function () {
           var permissions = cordova.plugins.permissions;
           permissions.hasPermission(permissions.READ_EXTERNAL_STORAGE, function (status) {
               if (status.hasPermission) {
                   // Permission has been granted previously, no need to request it again.
                   alert("has permission");  // I get this alert
                   //movePatFiles.testfile1();
               } else {
                   var error = function () {
                       // Permission has been denied. This example just logs warning, 
                       // make sure to handle this state in your application UI - e.g. 
                       // inform your user that you can't open the PDF without their permissions or similar.
                       console.warn('External storage permission has been denied');
                   };
                    var success = function (status) {
                       if (!status.hasPermission) {
                           // Permission has been denied.
                           error();
                       } else {
                           // Permission has been granted, present the document.
                           //presentDocument();
                           alert("got permission 2");
                           //movePatFiles.testfile1();
                       }
                   };
                    // Request the permission to read files from external storage.
                   permissions.requestPermission(permissions.READ_EXTERNAL_STORAGE, movePatFiles.moveSuccess, movePatFiles.moveFail);
               }
           })
       },
   
     
     
   
   ----------------------------------------
    From: "Norman Breau" ***@***.***>
   Sent: Thursday, September 16, 2021 6:10 PM
   To: "apache/cordova-plugin-file" ***@***.***>
   Cc: "janetcasarez" ***@***.***>, "Author" ***@***.***>
   Subject: Re: [apache/cordova-plugin-file] Cannot read files undercordova.file.externalRootDirectory for Android 11 (#494)   
   
      
   
   If you're app has the READ_EXTERNAL_STORAGE permission granted, in my testing reading from external storage works, however some APIs did not attempt to request permission. Reading directories was one of those methods. I have an open PR that corrects this specific issue, but not sure if that covers all cases for external storage. You can try applying that PR to see if it addresses your issue. Note that any app that has been prompted for external storage permissions but been previously denied may result in an automatic denial of the permission, in which case the user must navigate to the permission settings themselves to enable the permission.  
   
   READ_EXTERNAL_STORAGE permission isn't always necessary for reading files in external storage, but it is necessary when reading files that doesn't belong to your app. I believe anything outside of your application's external data directory is considered not own by your app (with the exception of the predefined MediaStore containers, which has some special rules).  
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.  
   
   


-- 
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] kalandher commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
kalandher commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-927613326


   > > I guess I should also mention. using preference name="android-targetSdkVersion" value="29"
   > > works fine. The problem shows up when set to 30.
   > 
   > I'll retry my test app against API 30, it's possible that I'm recalling memory while testing API 29 to see if I reproduce the same issue.
   > 
   > In my [test app](https://github.com/breautek/cordova-file-api30-test-app) I can read the directory to list them, while having the `READ_EXTERNAL_STORAGE` permission granted. I also `adb push` files into `/storage/emulated/0/` and appeared to be able to resolve the root external directory, `directoryEntry.getFile` to obtain the `FileEntry` and was able to read files fine.
   > 
   > Can you maybe try my PR via `cordova plugin add https://github.com/breautek/cordova-plugin-file.git#feat/api30` ?
   > 
   > Ref: #487
   
   getting below error while trying to build your test app
   
   ![image](https://user-images.githubusercontent.com/24358595/134865027-729167ab-c3ec-440b-879f-6581f19be71b.png)
   
   i also have latest build tools installed
   
   ![image](https://user-images.githubusercontent.com/24358595/134865221-465db416-3ad4-49d7-b8c0-9b9a72ee374a.png)
   


-- 
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] janetcasarez edited a comment on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez edited a comment on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-922026016


   I guess I should also mention. using preference name="android-targetSdkVersion" value="29" 
   works fine. The problem shows up when set to 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] ncomo11 edited a comment on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
ncomo11 edited a comment on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-938395163


   @janetcasarez I am able to see the attached manifest file. I am also facing the same issue only media files are visible not able to see any pdf files under Download folder.


-- 
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] janetcasarez commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
janetcasarez commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-928016273


   No change. I still can only read png files. 
   
   ![image](https://user-images.githubusercontent.com/90871039/134941070-92f0329d-87a4-4c72-a0b1-23cbd0ce7e31.png)
   ![image](https://user-images.githubusercontent.com/90871039/134942884-de8e750a-6e18-4e6b-91c3-8b4b0efd5f36.png)
   ![image](https://user-images.githubusercontent.com/90871039/134943132-a9add756-984f-493b-878b-8cd9de442974.png)
   It does not see the c2021827103827.cht file in image above.
   
   -------------------------
   alert(entries.legth) below is "1".  alert("entries[i].name:" + entries[i].name); is "entries[i].name: c2021827103827pattern.png"
   
   getPatternList30: function (entries) {
           // for each file 
           // get a file entry for the file
           alert(entries.length);
           for (var i = 0; i < entries.length; i++) {
               alert("entries[i].name:" + entries[i].name);
               try {
                   if (entries[i].name.indexOf(buy.enableCreateFilename) >= 0) {
                       entries[i].copyTo(movePatFiles.newFolderEntry, entries[i].name, movePatFiles.moveSuccess, movePatFiles.moveFail);
                   }
                   else {
                       entries[i].moveTo(movePatFiles.newFolderEntry, entries[i].name, movePatFiles.moveSuccess, movePatFiles.moveFail);
                   }
               }
               catch (error) {
               }
           }
           app.createFreePatFilesList(myPat.freePatList);
       },
   
   
   


-- 
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 #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-926863098


   You don't have git installed, or you don't have git in your system PATH variable.


-- 
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 edited a comment on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-923432540


   > I guess I should also mention. using preference name="android-targetSdkVersion" value="29"
   > works fine. The problem shows up when set to 30.
   
   I'll retry my test app against API 30, it's possible that I'm recalling memory while testing API 29 to see if I reproduce the same issue.
   
   In my [test app](https://github.com/breautek/cordova-file-api30-test-app) I can read the directory to list them, while having the `READ_EXTERNAL_STORAGE` permission granted. I also `adb push` files into `/storage/emulated/0/` and appeared to be able to resolve the root external directory, `directoryEntry.getFile` to obtain the `FileEntry` and was able to read files fine.
   
   Can you maybe try my PR via `cordova plugin add https://github.com/breautek/cordova-plugin-file.git#feat/api30` ?
   
   Ref: https://github.com/apache/cordova-plugin-file/pull/487


-- 
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] kalandher removed a comment on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
kalandher removed a comment on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-927613326


   > > I guess I should also mention. using preference name="android-targetSdkVersion" value="29"
   > > works fine. The problem shows up when set to 30.
   > 
   > I'll retry my test app against API 30, it's possible that I'm recalling memory while testing API 29 to see if I reproduce the same issue.
   > 
   > In my [test app](https://github.com/breautek/cordova-file-api30-test-app) I can read the directory to list them, while having the `READ_EXTERNAL_STORAGE` permission granted. I also `adb push` files into `/storage/emulated/0/` and appeared to be able to resolve the root external directory, `directoryEntry.getFile` to obtain the `FileEntry` and was able to read files fine.
   > 
   > Can you maybe try my PR via `cordova plugin add https://github.com/breautek/cordova-plugin-file.git#feat/api30` ?
   > 
   > Ref: #487
   
   getting below error while trying to build your test app
   
   ![image](https://user-images.githubusercontent.com/24358595/134865027-729167ab-c3ec-440b-879f-6581f19be71b.png)
   
   i also have latest build tools installed
   
   ![image](https://user-images.githubusercontent.com/24358595/134865221-465db416-3ad4-49d7-b8c0-9b9a72ee374a.png)
   


-- 
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] armandn commented on issue #494: Cannot read files under cordova.file.externalRootDirectory for Android 11

Posted by GitBox <gi...@apache.org>.
armandn commented on issue #494:
URL: https://github.com/apache/cordova-plugin-file/issues/494#issuecomment-1041324830


   What is the current state of this issue?
   
   I also can't read/write files using `externalRootDirectory`. It works with API 29 with `requestLegacyExternalStorage` in config.xml but fails when compiled with API 30, which is now required.


-- 
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