Crosswalk and $http doesnt work

Worked for me, had to install cordova-plugin-whitelist through the following command:

cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
8 Likes

@mwagena This work for me too.

Now, collection-repeat looks smoother. (With crosswalk)

This worked for me too. Thanks!

this is really working for me. i was tired from last 3-5 days finally it done.
but still i didnā€™t understand that what was the problem and what is under plugin cordova-plugin-whitelist

I believe that cordova-plugin-whitelist intercepts all outgoing requests and only allows the ones specified in the whitelist to reach their destination.

The whitelist seems to be located in config.xml as specified in the Network Request Whitelist section of cordova-plugin-whitelistā€™s README.

@vicky443 - I had the issue of all http requests failing. I just installed the whitelist plugin, rebuilt the .apk and everything went smoothly.

1 Like

every time when I make a $http get the app stops.
most weird is, sometimes some requests works.
no error log. just stop.
with Crosswalk. with meta tags, iā€™ve tried everything in this page.
someone have the same issue?

1 Like

Iā€™ve tried everything to get my http posts to workā€¦ is this an issue with Cordova or the SDK? worked perfectly on SDK 7.1

Thanks @bradmartin! That worked for me too.

Iā€™ve tried all of the proposed solutions here, whitelist plugin, adding xwalk_hosts to ionic project and editing source in platforms, but none of those solution work for me.

This is what i get when I log the response from the server ($ionicUser is doing the post):

{"data":null,"status":0,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"url":"https://apps.ionic.io/api/v1/app/********/users/identify","data":{"is_on_device":true,"device":{"screen_width":800.0812929868698,"screen_height":1172.8313130140305,"model":"Nexus 7","platform":"Android","version":"5.1.1","uuid":"771f99149b9b06fd"},"_id":"92bf0ca0-1b38-44b5-8b83-b08b148b2a2c","user_id":"ionic101","name":"Ionitron","message":"I come from planet Ion","bio":"I come from planet Ion","username":"ionitron","age":9001},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json;charset=utf-8","If-Modified-Since":"Mon, 26 Jul 1997 05:00:00 GMT"}},"statusText":""}

Iā€™m using crosswalk version 12.41.296.5

Hereā€™s output from ionic info:

Cordova CLI: 5.0.0
Gulp version:  CLI version 3.8.11
Gulp local:   Local version 3.8.11
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.0
Ionic App Lib Version: 0.1.0
ios-deploy version: Not installed
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.4
Xcode version: Xcode 6.3.2 Build version 6D2105

So you just installed thatā€™s plugin without change anything on config.xml?

Yes, I already had the tag
access origin
so installing the plugin was it for me but you might need to have this tag, I think it defaults to that with ionic starters though (been awhile since Iā€™ve even modified a config.xml file).

Just follow up the question

I have a problem equal. Exist a soluction??

I didnā€™t resolve the issue. Last thing i found that could help is: https://docs.angularjs.org/api/ng/directive/ngCsp
Let me know if that helps.

1 Like

I am having this same issue, but its only happening when I build a --release apk. Iā€™ve tried everything and it still refuses to work. I get the same error with a status of 0.

Please help!

Iā€™ve got the same problem. On debug version it works perfect, but after build release I canā€™t use $httpā€¦

Turned out I was using my API with HTTPS, but my backend server had a self-signed SSL certificate which Android did not like. Switched to just HTTP and it works fine. I will have to get a properly signed SSL certificateā€¦

I had this exact problemā€¦http doesnt work in release mode. In the end, it was because my SSL wasnt setup right. Try viewing your api in a normal chrome window (on android) and check if you get a green or red padlock.

For me, it was because I had forgot to concatenate my intermediate rapidSSL CA certificate to the certificate file pointed to by nginx.

Crosswalk shouldnt change its request behaviour between dev and release reallyā€¦this wasted hours.

Remove all plugins that crosswalk affected it and reinstall again and then build your app
this solve my issue for plugins SQLite , socialsharing , and dialogs