Software Archive
Read-only legacy content
17061 Discussions

xdk 2496 - iOS build fails if using CLI 5.1.1

Michael_K_13
Beginner
464 Views

tl;dr: When I switch my app to use Cordova CLI 5.1.1, iOS will not successfully build. This is not dependent on plugin version, only CLI.

long version:  I Installed the upgrade XDK today, to 2496, and converted the app I was working on.  Went in and upgraded CLI to 5.1.1 and also chose to upgrade all plugins.  Android build worked, but iOS did not.  My app uses html5 audio tags, and the device, notification, geolocation, socialsharing and inappbrowser plugins.

I regenerated and uploaded certs and provisioning.  I also added to, and then removed whitelisting (BTW, whitelisting in iOS disappeared, and seemed different in android build settings too, but not 100% sure).  No love for iOS.

Added new screenshot images. Also, killed the splash screen plugin, and then added it back ... still no iOS love.

Finally, kicked the CLI back down to 4.1.2, and it also downgraded the plugin versions. Aha - finally, iOS builds!

Brought CLI back to 5.1.1, but left plugin versions to stay legacy. Again, no iOS build.

Currently, I am leaving plugins as they were before, but putting android at 5.1.1 and leaving iOS at 4.1.2 which seems to be working fine.  I will play with plugin versions if there is new functionality that I would like to see (particularly social sharing got to be a mess, perhaps with ios 9).

ADDITIONAL NOTE: Cordova iOS build failure does not provide link to build logs, as the android build failures do. Can you tell me where these logs are, it would be extemely useful to have access to those!  Attached is screenshot where you can see there is no link (i also selected across to see if perhaps the link was in black txt and thus invisible - no luck)... thanks!

Michael D. Kastler
43Folders Technology Solutions

-- Custom development, web design, consulting, and more! -- 
0 Kudos
1 Solution
Eric_H_Intel
Employee
464 Views

Michael,

CLI 5.1.1 has more restrictive requirements for the App Id/Package Name than previous versions.   The processing limits the App Id to the minimum set for all platforms.  

The current requirements are for CLI 5.1.1:  

- Each section of the App Id must start with a letter
- Each section can only consist of letters, numbers, and the underscore character
- Each section cannot be a Java keyword
- The App Id must consist of at least 2 sections (each section separated by a period ".").

The second section of the App Id you are using begins with a number and fails the validation.   I am looking at reducing the App Id requirements to the 4.1.2 level but that is not in place today.   I will also add more information so this error is obvious when your build fails.

Whitelisting in the currently released cordova-ios platform does not use the new plugins.   It is still using the legacy whitelisting from previous versions of Cordova.   The new whitelisting plugin will be used for iOS when cordova-ios 4.0 is released.

Eric

View solution in original post

0 Kudos
8 Replies
PaulF_IntelCorp
Employee
464 Views

Michael -- if there is no detailed build log it usually means the build setup scripts failed, so the actual build never started. This is most often due to some plugin retrieval troubles (the build system creates a new Cordova project with each build, during that process it has to retrieve and add plugins into the project, then it can perform an actual build). The build engineer is working on more details for that step in the process, which will make it easier to diagnose these problems.

In the meantime, if you could provide a sample app that fails it will help us to identify the issue with iOS and CLI 5 builds. A blank template app that includes the versions of plugins that are causing the iOS build fail at CLI 5 would be perfect. Just attach it to a post in a ZIP file. Please zip the ENTIRE project directory.

0 Kudos
Eric_H_Intel
Employee
465 Views

Michael,

CLI 5.1.1 has more restrictive requirements for the App Id/Package Name than previous versions.   The processing limits the App Id to the minimum set for all platforms.  

The current requirements are for CLI 5.1.1:  

- Each section of the App Id must start with a letter
- Each section can only consist of letters, numbers, and the underscore character
- Each section cannot be a Java keyword
- The App Id must consist of at least 2 sections (each section separated by a period ".").

The second section of the App Id you are using begins with a number and fails the validation.   I am looking at reducing the App Id requirements to the 4.1.2 level but that is not in place today.   I will also add more information so this error is obvious when your build fails.

Whitelisting in the currently released cordova-ios platform does not use the new plugins.   It is still using the legacy whitelisting from previous versions of Cordova.   The new whitelisting plugin will be used for iOS when cordova-ios 4.0 is released.

Eric

0 Kudos
Michael_K_13
Beginner
464 Views

Thanks Eric - that makes some sense ... i was not able to duplicate the issue when building from new, but probably because I was naming the app more sensibly :)   I have had more problems, coming from a business name that starts with numbers ... ::sigh::

I will try altering the app ID, updating to 5.1.1 and see if that works for me - but I strongly suspect you are right.  Thanks also to you and Paul for paying attention to the fact that there is literally zero information about why the build fails ... even a line telling you at what line in the build code it ended at would be helpful to everyone it would seem to me.

I will update if the naming does not resolve the issue, and thanks!

/mdk

Michael D. Kastler
43Folders Technology Solutions

-- Custom development, web design, consulting, and more! -- 

0 Kudos
John_H_Intel2
Employee
464 Views

There would be 2 possible solutions.

1. Upstream a fix to Cordova so it allows the same chars in the appID that Apple allows.

2. Hack a fix into place into the current version of Cordova.

#1 would be best, but takes time. #2 is something that we try to avoid because if we take this approach, we are no longer offering Cordova builds, its a hacked Cordova build that we have to remember to keep 'hacking' with each Cordova release. The simplest fix is to just use a appID of standard chars. If you app is in the store already with non standard chars then thats a different issue...

0 Kudos
Chris_G_7
Beginner
464 Views

Hey guys,

I have an app in the store that actually starts with a number. I haven't updated it in a while and am looking to push an update. The intel xdk is updated to the latest. I had to update a bunch of plugins to get Android to build. Can't really go back to Cordova 4.1... What do you recommend that I do? Is there some file I can change to prevent the iOS build from throwing an error due to the appid name?

Thanks :)

0 Kudos
PaulF_IntelCorp
Employee
464 Views

Chris -- you might be able to handle it using the technique described here > http://dev.mlsdigital.net/posts/how-to-resign-an-ios-app-from-external-developers/ < where you would build with an App ID that Cordova will allow and then modify and re-sign the package. Those instructions assume you've got a Mac, but you may be able to resign without a Mac > https://gowithfloat.com/2011/11/re-signing-an-ios-app-without-xcode/ < or search for similar resources. Depending on the iOS features your app requires, you may be able to get away with a wildcard provisioning file > https://developer.apple.com/library/ios/qa/qa1713/_index.html <

0 Kudos
Chris_G_7
Beginner
464 Views

Thanks for the tips.

I do need gamecenter, so I can't use the wildcard.

It's pretty ridiculous that Cordova would do this to people that have previously successfully built apps in the system. I guess I'll have to figure out how re-sign the app (such a bummer). You talk above about 'hacking a fix in place into the current version of Cordova', is this to just prevent it from throwing an error. Is there actually a reason that this exists? If you allowed us to enter numbers into the XDK and tried to build, would cordova itself fail?

 

Thanks again,

-Chris

0 Kudos
PaulF_IntelCorp
Employee
464 Views

Chris -- we would have to "hack" Cordova to make it work. Which becomes a major maintenance headache, so we try to minimize the variances from standard Cordova, otherwise it becomes difficult for us to keep up with new Cordova releases.

0 Kudos
Reply