I got that issue on my cordova project, created with angular and ionic. I've tried everything I could, and it ain't working.
Here's the code :
function getSuccess(response) {
$scope.modules = response.modules;
$scope.list = $scope.modules;
$scope.search = [
{str: ""}
];
}
$http({method: 'GET',
url: "http://xxx.xxx.xxx.xxx/api/modules"
})
.success(getSuccess)
.error(function (response){
alert("Damned");
});
Of course, the IP is valid, and works in the chrome browser ;)
That's in my controller. I already added <access origin="*"/>
in my config file and it's still displays the "Damned" on my android device, after building.
Cordova version : 5.0.0 Android version : 5.1
response
should contain details about the error. don't output a fixed(useless) error message when you can be told exactly what's wrong.alert(JSON.stringify(response))
could help. anything to get the contents of the error object out and viewable.