Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: problem with downloading data from url #10

Open
buffy007 opened this issue Sep 30, 2019 · 5 comments
Open

BUG: problem with downloading data from url #10

buffy007 opened this issue Sep 30, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@buffy007
Copy link

buffy007 commented Sep 30, 2019

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 (cordova-lib@9.0.1)
`

@buffy007 buffy007 added the bug Something isn't working label Sep 30, 2019
@PeterHdd
Copy link
Owner

PeterHdd commented Oct 1, 2019

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

@buffy007
Copy link
Author

buffy007 commented Oct 1, 2019

I tried install it
cordova plugin add cordova-plugin-crypto-file@latest
or
cordova plugin add cordova-plugin-crypto-file@1.4.0
but still see version 1.2.1

@irhosseinz
Copy link

irhosseinz commented Feb 17, 2020

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

@buffy007
Copy link
Author

buffy007 commented Feb 18, 2020

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.

@IllusionVK
Copy link

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.. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants