I built an app using the $http service which works nice in debug mode.
However, when I build a release and run it on Android none of the requests work (neither HTTP nor HTTPS).
What I did so far:
whitelist plugin reinstalled
put into config.xml: <access origin="*" subdomains="true" /><allow-navigation href="https://*/*" /><allow-navigation href="data:*" />
are you using self signed certificates? If so, you either need to make changes to SystemWebViewClient.java or use some plugins. I had a custom version of SystemWebViewClient to enable SSL to work with untrusted certs, but crosswalk uses other files, so I landed up just switching between two different plugins based on which build I was creating (with or without xwalk)
Thank you. The certificate is by Let’s Encrypt and ssllabs or Chrome browser did not find any problems.
What I find most strange is, that even HTTP (without S) does not work, the .error(function(data) { … }) gives me undefined for data :-/
I tried the crosswalk plugin without success, only the HTTPS requests seem to take much longer until I get to see the error message.
Any more ideas?
Is there a way to debug this in a release build?
same my app. I test on browser so cool faster and post service work done.but when i build on device perfomance so slow and my button for post json not work.I tried alert pop up in method http.post for show any event handling but not anything. another solution I reinstall cordova whitelist,edit config.xml–> ,edit index.html same you and add getbutton(http.get)and alert for check.so it works but post button not work.
If neither HTTP nor HTTPS are working, the chances are very high its a Content Security Policy issue.
Can you try using this one, verbatim and see what happens?
Thank you, now it works with HTTP and https://www.google.de. So I’m guessing it is a self-signed cert issue. But the certificate got rated A+ by ssllabs.com Is it possible that the Ionic library does not accept Let’s Encrypt yet?
Ok, resolved / dammit
Locally the domain is resolved to a local IP address going a different route with a different certificate. @Pliablepixels, thanks for your great support!
@shiziluosidao Can you please tell me how did you resolve the issue. I have also tried everything suggested everywhere but not solution.
Banging my head from past 2 days.
My problem was an Apache server with an incorrectly configured HTTPS certificate. Therefore it did not load the page. If your server is properly setup (with like LetsEncrypt) it should work when allowing access in your config.xml
how did you verify that this is an invalid certificate? I have the same problem but the site certificate works correctly on browsers and the ssl check tells me that the certificate is valid. But I have seen that the problem occurs only on android devices <5.1