Ajax call not working on android 2.2.2 when debuggable=false

328 views
Skip to first unread message

Henrik S

unread,
Apr 24, 2012, 8:26:03 AM4/24/12
to phonegap
Hi!

I have a slight problem when turning off the debuggable flag in the
android manifest my javascript ajax calls won't work specifically in
Android 2.2.2 .. other higher versions works without a hitch.

Full permission Internet is turned on
<uses-permission android:name="android.permission.INTERNET" />

cordova.xml
<access origin="*">

Is this a bug or simply a configuration matter?

For now my app simply runs with debuggable=true to make it work...

Is it any big downsides not turning off that flag in a released app?

Libby

unread,
Apr 24, 2012, 10:45:31 AM4/24/12
to phon...@googlegroups.com
Is it any big downsides not turning off that flag in a released app?

Yes, the downside is that you won't be able to sign the app
(create release version) with debuggable=true.

Libby 

Henrik S

unread,
Apr 25, 2012, 12:39:02 PM4/25/12
to phonegap
Yeah i noticed that when signing it automatically sets that flag to
false. So far i've come to the conclusion that it is not an issue with
phonegap but with Ext Js (Sencha Touch 2) as ajax requests done with
jquery is working.
I hope it is just a configuration issue. Odd that it only shows upp
when debuggable false and only android 2.2.2... .. so i guess im
moving over to senchas forums..

Ext.Ajax.request , not working when debuggable:false

Ext.Ajax.request({
dataType: 'json',
url: reqUrl,
success: function(response){
},
failure: function(response){
console.log("ajax request failed");
},
callback: function(opt, success, response){
console.log("----------------- Ext.Ajax.request response
start ---------------------");
console.log("Ext.Ajax success: "+ success);
console.log("Ext.Ajax status code: "+ response.status);
console.log("Ext.Ajax status text: "+ response.statusText);
console.log("Ext.Ajax reponseText length: "+
response.responseText.length);
console.log("Ext.Ajax reponseText: "+
response.responseText);
console.log("----------------- Ext.Ajax.request response end
----------------------");
}
});
----------------- Ext.Ajax.request response start --------------------
Ext.Ajax success: true
Ext.Ajax status code: 0
Ext.Ajax status text:
Ext.Ajax reponseText length: 0
----------------- Ext.Ajax.request response end ----------------------



$.ajax request , works in both cases, debuggable: false|true
$.ajax({
url: reqUrl,
dataType: 'json',
success: function(response, textStatus, jqXHR){
console.log("----------------- $.ajax request response start
---------------------");
console.log("$.ajax success: "+response.success);
console.log("$.ajax status code: "+jqXHR.status);
console.log("$.ajax status text: "+jqXHR.statusText);
console.log("$.ajax reponseText length:
"+jqXHR.responseText.length);
if(response.success){
console.log("$.ajax json objects: "+response.data.length);
}
console.log("$.ajax reponseText: "+jqXHR.responseText);
console.log("----------------- $.ajax request response end
----------------------");
}
});

----------------- $.ajax request response start ---------------------
$.ajax success: true
$.ajax status code: 200
$.ajax status text: OK
$.ajax reponseText length: 450
$.ajax json objects: 4
----------------- $.ajax request response end ------------------------

Steve Drucker

unread,
Nov 14, 2013, 7:22:18 PM11/14/13
to phon...@googlegroups.com
Did you figure out a solution, Henrik S?
Reply all
Reply to author
Forward
0 new messages