Hi,
I’m not able to list/read files recursively inside directories, Returning array length of ‘0’.
Here is the code:
async listFilesinFolder(folderName) { console.log('Iniital folderName', this.file.externalRootDirectory + folderName); await this.file.listDir(this.file.externalRootDirectory, folderName).then(async (filesList) => { console.log('2. filesList', filesList); }); }
Version information
“@awesome-cordova-plugins/file”: “^5.41.0”,
“cordova-plugin-file”: “^7.0.0”,
Environment, Platform, Device
Android 11
Included below in config.xml:
<access origin="*" /> <access origin="cdvfile://*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> <allow-intent href="file://*/*" /> <allow-intent href="tel:*" /> <allow-intent href="sms:*" /> <allow-intent href="mailto:*" /> <allow-intent href="geo:*" /> <preference name="android-minSdkVersion" value="21" /> <preference name="android-targetSdkVersion" value="30" /> <preference name="ScrollEnabled" value="false" /> <preference name="BackupWebStorage" value="none" /> <preference name="SplashMaintainAspectRatio" value="true" /> <preference name="FadeSplashScreenDuration" value="300" /> <preference name="SplashShowOnlyFirstTime" value="false" /> <preference name="SplashScreen" value="screen" /> <preference name="SplashScreenDelay" value="3000" /> <preference name="AndroidXEnabled" value="true" /> <preference name="AndroidPersistentFileLocation" value="Internal" /> <preference name="AndroidPersistentFileLocation" value="Compatibility" /> <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" /> <platform name="android"> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:networkSecurityConfig="@xml/network_security_config" /> <application android:requestLegacyExternalStorage="true" android:usesCleartextTraffic="true" /> </edit-config> <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />