pepenemo edited a comment on issue #408: URL: https://github.com/apache/cordova-plugin-file/issues/408#issuecomment-670449055
> I can confirm that the same line from PR #410 put manually in config.xml solves the problem. > I could not install PR 410 since that exact line was conflicting with an edit-config tag we have i our config.xml. > > Just to add some details, we had this line in our config.xml: > > ``` > <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application"> > <application android:usesCleartextTraffic="true" /> > </edit-config> > ``` > > Installing @eliadAfeka 's fork gave us this error: > > ``` > Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added. > ``` > > So we edited our config.xml to look like this: > > ``` > <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application"> > <application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"/> > </edit-config> > ``` > > and the problem seems to be solved. > > Thanks everyone for your help. I had the same issue and it was fixed of the comment added by @rastafan (_quoted reply_) in my Samsung phone - Android 10. I added the code - "android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"" in the directory <ProjectName>/plaforms/android/app/src/main/AndroidManifest.xml AndroidManifest file added code in the application tag: `<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" android:requestLegacyExternalStorage="true" android:usesCleartextTraffic="true">` and also to add, I used the `cordova.file.externalRootDirectory` to save the file in the android device. I don't know yet if the fixed would work in the lower android API version up to 22. Special thanks to this thread: @rastafan @breautek @peterfox1 @HansKrywaa @hariagustian @eliadAfeka ---------------------------------------------------------------- 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]
