Open gabriele-sacchi opened 5 years ago
( raised also on Stackoverflow: https://stackoverflow.com/questions/55261705/file-upload-not-working-for-android-in-cordova-project )
Issue solved with this PR: https://github.com/apache/cordova-android/pull/707
I'm currently using this forked version of cordova-android until my Pull Request gets approved.
Hallo @gabriele-sacchi
I try to do a local fix, but it doesn't work... how you test this fix? and with which cordova/cordova-android versions is it compatible/possible?
@gabriele-sacchi what do you have writen on your ng-file upload directive? You branch on my huawei 8.1 with ngf-camera="'other'" or ngf-capture="'camera'" and ngf-accept="'image/*'" doesn't work.
@WuglyakBolgoink did you find any solution to test it?
I did only:
ionic cordova platform add https://github.com/gabriele-sacchi/cordova-android
then in node_modules/cordova-android i have the patched version but to me doesn't work.
How can I make this directive work in a Cordova project?
It works on iOS but not on Android as reported in this older issue.
The old issue had been closed because the following solutions were available:
How can I solve this please? The HTTP request is not sent at all.
Additional info:
Logs found in LogCat:
Explanation of the log:
The error is telling you that the device has no applications installed that are able to handle that particular implicit intent.
-> that is not the case thoughIt does not seem to be a permissions issue: The (Cordova) Android App works when for the upload button I use
<input type="file" />
in place of your directive.( we already provide all the required permissions: )
I am whitelisting everything in my config.xml for cordova: access, allow-navigation, allow-intent, CSP. Still no luck.
We don't have control over the Android code (unless we write a custom plugin). Would this native code solve the issue?
myWebView.getSettings().setJavaScriptEnabled(true); myWebView.getSettings().setAllowFileAccessFromFileURLs(true); myWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);