Closed qqakashi closed 2 years ago
Any update? After upgrade to API 29 (mandatory in November 2020 at Google Developer) file transfer don't works in android (still working in iOS)
@sbellver yes ,after upgrade to cordova-android 9.0 file transfer don't works in android
I'm having no trouble using this plugin on AndroidX with cordova-android 9.0 we're using the cordova-plugin-androidx-adapter plugin perhaps that is what you are missing @sbellver @qqakashi
Yes, is an issue about AndroidManifest permissions about filestorage
I set it manually and works, but i think using androidx-adapter will be more permanent
I have the same problem. In the documentation of new Android versión (https://developer.android.com/about/versions/11/privacy/storage) talk about of permission "ACTION_MANAGE_STORAGE".
I've add this permission to AndroidManifest.xml and it works fine:
<uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE" />
I am facing a same problem. Did anyone find any solution to this?
Add https://www.npmjs.com/package/cordova-plugin-androidx-adapter plugin to your ionic app
I am facing same problem. i am in ionic 1 project using cordova 5.4.1. can you give solution for this?
@sbellver i tried to install androidx-adapter plugin but it is not getting in my project.
You can (must) upgrade to cordova 8. I'm on Cordova 9.0 and still with ionic 1
I've add this permission to AndroidManifest.xml and it works fine:
<uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE" />
Anyone else tried this solution? Does it work for android 11?
I've add this permission to AndroidManifest.xml and it works fine:
<uses-permission android:name="android.permission.ACTION_MANAGE_STORAGE" />
Anyone else tried this solution? Does it work for android 11?
Did you find a solution?
@sebafra apparently that solution works only for Android 10. For Android 11 a working solution is to use a social sharing plugin that allows the user to save the file whenever he wants, but it works only for saving a file outside of App's sandbox, not for reading. Check also this thread: https://github.com/apache/cordova-plugin-file/issues/426
@sebafra apparently that solution works only for Android 10. For Android 11 a working solution is to use a social sharing plugin that allows the user to save the file whenever he wants, but it works only for saving a file outside of App's sandbox, not for reading. Check also this thread: apache/cordova-plugin-file#426
I need to read files from gallery, social sharing plugin allow to do this?
I need to read files from gallery, social sharing plugin allow to do this?
No, it is just a workaround to save files, not to read!
for anyone struggling with this , use this solution : modify FileTransfer.java as follow :
remove :
import org.apache.cordova.Whitelist; add :
import org.apache.cordova.AllowList;`
remove:
Boolean shouldAllowRequest = null;
if (isLocalTransfer) {
shouldAllowRequest = true;
}
if (shouldAllowRequest == null) {
try {
Method gwl = webView.getClass().getMethod("getWhitelist");
Whitelist whitelist = (Whitelist)gwl.invoke(webView);
shouldAllowRequest = Whitelist.isUrlWhiteListed(source);
} catch (NoSuchMethodException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
}
add :
Boolean shouldAllowRequest = null;
if (isLocalTransfer) {
shouldAllowRequest = true;
}
if (shouldAllowRequest == null) {
try {
Method gwl = webView.getClass().getMethod("getWhitelist");
AllowList whitelist = (AllowList)gwl.invoke(webView);
shouldAllowRequest = whitelist.isUrlAllowListed(source);
} catch (NoSuchMethodException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
}
Feature Request
Motivation Behind Feature
Feature Description
Currently, the identification path cannot be found on the Android 10 device, indicating error code 1 and permission error
Alternatives or Workarounds