cordova-plugin-crypto-file icon indicating copy to clipboard operation
cordova-plugin-crypto-file copied to clipboard

BUG: problem with downloading data from url

Open buffy007 opened this issue 6 years ago • 5 comments

I'm not sure, what is wrong, but I found this unexpected behaviour. I have simple app which downloads json from url with $.getJSON function in javascript and shows data on screen. Simple and easy. Everything is fine on cordova 7. But I updated to cordova 9 (android 8.1.0) and same js script is not working. I tried many ways to fix, but if I uninstall cordova-plugin-crypto-file everything is OK again. I need to update android to api-28 at least, but with latest version of cordova and android SDK I can't download data from url if I'm using cordova-plugin-crypto-file. How can I fix it?

What I tried

  • I also tried server-side script with counter and app try download data, but nothing show.
  • I also tried cordova-plugin-file and cordova-plugin-file-transfer for downloading JSON from url and same behaviour. Without crypto file plugin app is working, with plugin I can't open downloded JSON file.
  • I tried download json from server with http and also with https, same problem.
  • I tried also $.get function

Anybody with same problem? What could be wrong?

` cordova plugin cordova-plugin-crypto-file 1.2.1 "Crypt File" cordova-plugin-whitelist 1.3.4 "Whitelist"

cordova platform Installed platforms: android 8.1.0

cordova --version 9.0.0 ([email protected]) `

buffy007 avatar Sep 30 '19 15:09 buffy007

Try and use the latest version of cordova-plugin-crypto-file. The latest version is 1.4.0

PeterHdd avatar Oct 01 '19 05:10 PeterHdd

I tried install it cordova plugin add cordova-plugin-crypto-file@latest or cordova plugin add [email protected] but still see version 1.2.1

buffy007 avatar Oct 01 '19 13:10 buffy007

I have this problem too. var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { }else if(xhttp.readyState == 4){ //it goes here with xhttp.status=0 } }; xhttp.open("GET",url, true); xhttp.send(); using 1.4.0. and trying to load a data json url and I get nothing in return, if I remove the plugin it works fine

irhosseinz avatar Feb 17 '20 08:02 irhosseinz

Finally I fixed this issue. I had to use old cordova-plugin-crypt-file plugin. I repaired after_prepare.js and it's working for Android 9 and also for last iOS. I spent so much time with fixing this crypto plugin, but without success.

buffy007 avatar Feb 18 '20 08:02 buffy007

Hey @buffy007 are you able to add your changes as a pull request or perhaps link to the repo changes you made ? it would be a great help for us all and it would help to make sure that people keep on using cordova-plugin-crypt-file, which is good for all of us who uses it so that it doesn't die.. 👍

IllusionVK avatar Mar 08 '20 08:03 IllusionVK