我无法在 Android 11 版本设备中下载文件。
\n**Details :**\n\ncordova android 10.1.0 \n"cordova-plugin-file" version="6.0.2" \n"cordova-plugin-file-transfer" version="1.7.1" \n"cordova-plugin-filepath" version="1.6.0" \n\n**My Code:**\nRun Code Online (Sandbox Code Playgroud)\n下面的代码是我编写的下载文件设备,它在 android 9 和 10 中工作,当我以 SDK 30 为目标时,它不起作用并且仅在 android 11 中失败。
\nwindow.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, function(dir) {\n dir.getFile("test.pdf", {create:true}, function(file) {\n file.createWriter(function(fileWriter) {\n fileWriter.write("byteArrays data");\n alert('Message',\xc2\xa0'File Downloaded Successfully');\n }, function(){\n alert('Error!', "Unable to save the file");\n });\n },function(e){\n alert('Error!', e);\n });\n},function(e){\n console.log(e);\n});\n\n**I tried with below code in Androidmainfest file**\n\n<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />\n<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />\n<uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE" />\n<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>\n\n\n\n**Config.xml file**\n<preference name="AndroidInsecureFileModeEnabled" value="true" />\n<preference name="AndroidPersistentFileLocation" value="Compatibility" />\n …Run Code Online (Sandbox Code Playgroud)