Software Archive
Read-only legacy content
17061 Discussions

iOS Build not connecting the server

Mike_C_2
Beginner
995 Views

I was doing some routine updates to my code when the iOS build suddently wasn't able to connect to the server via AJAX calls. All the code I have has worked thousands of times before on build, and still works just fine in emulator. I hadn't changed any connection functions between when it was working and not working. I've restarted my system and device with no luck. I uninstalled and installed the app with no luck. I have even opened and  built other I versions I had backed up and have worked in production (versions that the public is using currenly), and they won't connect either through an XDK build out.

 It's almost as if now XDK is preventing builds from connecting to servers once they are built.

What's happening here? 

0 Kudos
19 Replies
Swati_S_Intel1
Employee
995 Views

From what you are saying it looks like there might be some server side issue.

If your existing builds (that your customers are using) used to work before and are not working now, that means something on server (the one that you are making AJAX request to) went wrong. Once the project is built it has no bearing on XDK. So please check your server side code (if it's yours) or check if any configuration requirements have changed on the website you are trying to connect.

If you are having issue with only newly built binary, please let us know which version of XDK are you using. Also, make sure all the whitelisting settings are correct. If it does not work, please send your project zip via PM.

0 Kudos
Mike_C_2
Beginner
995 Views

The existing build that customers are using work and loads just fine.

The version I am building now is an update, with the AJAX urls identical to the public working version. The only diference between the working public version and the newer version that isn't connecting after XDK build is the wording of a few <p> blocks in the HTML. The newer version will connect in emulator, but not in build.  So yes, I am only having problems with newly built binaries. My whitelist has remained the same as well. I even tried making it the default http://*, but it didn't work.

I am running 2893 on OS X El Captian.

 

0 Kudos
Elroy_A_Intel
Employee
995 Views

I recommend testing your application via the Debug tab within Intel XDK or via the Test Tab including the weinre script tag after the body tag in your index.html file. Both options will allow you to view the network traffic of your application so that you can better determine the issues or errors you might be encountering.

In order to evaluate your project with the Debug Tab, you will need to connect your iOS device to your computer via a USB cable. Once the application is running your should be able to navigate the developer tools via the Debug Tab to view the network traffic.

On the other hand, in order to evaluate your project with the Test tab, you will need to include the weinre script tag located on the Test tab then perform an iOS Build to install and run the application on your device. Once the application is running your should be able to navigate the developer tools via the Test Tab to view the network traffic.

0 Kudos
Mike_C_2
Beginner
995 Views

It was able to connect to the server without a problem in the Test tab. Couldn't get it to recognize my phone in Debug (and never have). But still won't connect on build. It fires the error param for all AJAX calls. 

0 Kudos
Swati_S_Intel1
Employee
995 Views

Mike, We are looking into this issue. If you are able to, can you please see what status does the AJAX call return? 

0 Kudos
CAJazzer
Beginner
995 Views

I have tested from the Debug tab to a signed version of the app preview.  My AJAX code works fine there.  As Mike states, its only in the deployed app that it fails in the ajax success function.  I am expecting data to be returned but get nothing (undefined) back.  I own the servers that I am connecting to and they are responding to the same ajax requests from browsers and the Test and Debug tabs.  Thanks.

0 Kudos
Mike_C_2
Beginner
995 Views

I'm getting a error status 0 and text undefined. Same as CAJazzer. 

For the record, I've built a basic cordova HTML/Cordova app with one simple AJAX call. Same problem. Works in Emulate and Test, but fails to connect in binary.

 

0 Kudos
PaulF_IntelCorp
Employee
995 Views

Engineering is looking into this issue.

0 Kudos
PaulF_IntelCorp
Employee
995 Views

@Mike -- does it make any difference if you build with CLI 4.1.2 or CLI 5.1.1? Which CLI are you building with now? Please try both and reply with results.

0 Kudos
Marcio_G_
Beginner
995 Views

I also have the same problem, this problem begins when I upgrated do CLI 5.1.1 yesterday. When I build the app all ajax returns status 0 and response text "" , in emulator works fine.

I have tried many options in Whitelist, using Cordova Whitlist, W3C Widget Acess, put xhr.js in code, crossDomain: true in ajax requisition and Access-Control-Allow-Origin: * in server, and nothing work.

I'm using Intel XDK 2893 and have the same problem in Android Build.

0 Kudos
PaulF_IntelCorp
Employee
995 Views

@Mike -- can you also try changing the format of your whitelist rule fields on the iOS so they do not include a protocol?

For example, change:

http://debug-software.intel.com/*

to:

*.intel.*

And let me know if anything changes as a result...

0 Kudos
Marcio_G_
Beginner
995 Views

Paul F. (Intel) wrote:

@Mike -- can you also try changing the format of your whitelist rule fields on the iOS so they do not include a protocol?

For example, change:

http://debug-software.intel.com/*

to:

*.intel.*

And let me know if anything changes as a result...

 

I tested here in Android (W3C Widget Access) and returned the same problem, statusCode: 0.

0 Kudos
André_V_
Beginner
995 Views

Same error. I stopped  try change my project and did a simple example with google maps and doesn't work.

I tried this example http://codepen.io/ionic/pen/uzngt , works in android and emulator but doesn't work in real ios device.

My project was working fine until the last update and now I can't connect with soap, http, web service and google maps api.

XDK test tab was working with ios device, but now isn't working.

0 Kudos
Mike_C_2
Beginner
995 Views

I was/have been running 5.1.1.

Looks like the same result and errors when I downgraded to 4.1.2, although I did not downgrade the plugins, just the CLI.

When I reformatted the URL to the format you suggested, I got a different Error:

Error Thrown: Unauthorized

status: 401

text response: ERROR whitelist rejection: url="http://www.....

 

0 Kudos
PaulF_IntelCorp
Employee
995 Views

@Mario -- when you say you "have the same problem in Android Build" -- do you mean that AJAX was working prior with your Android builds and now is not?

0 Kudos
PaulF_IntelCorp
Employee
995 Views

Mike, thanks for the additional feedback. Engineering continues to investigate.

0 Kudos
PaulF_IntelCorp
Employee
995 Views

@Mike -- engineering believes they have located the root of the problem and is pushing a fix to the iOS build servers. You can try it now.

0 Kudos
Mike_C_2
Beginner
995 Views

Success! Thanks for sticking with it, I really appreciate your support.

Keep up the good work!

0 Kudos
PaulF_IntelCorp
Employee
995 Views

Glad it worked! I'll let engineering know that it was successful.

0 Kudos
Reply