Was bundle ID distorted during an iOS build

Hello everyone,

I am an experienced native developer with dozens of apps successfully submitted to the App Store over the years, now trying Corona, and I am quite impressed by it. I created my first simple app and trying to submit it to the App Store. I am quite comfortable with code signing and all those tedious things - as far as it is possible to be comfortable with them. At least, I did all that stuff many, many times but following the usual native route. Now I am trying to do it the Corona way.

Let’s say, the bundle ID of my app is com.companyname.ios.AppName. I specified it in the build.settings like so:

CFBundleIdentifier = “com.companyname.ios.AppName”

Everything worked fine, including running the app on iOS emulator and on a couple of devices with development signing,  until I decided to submit the app to the App Store. I did all the necessary preparations on the iTunes Connect side, the app is “Waiting for Upload” there.

In the Corona’s Build for iOS dialog I specified Application Name as AppName, and the Application Loader produced the following error:

ERROR ITMS-9000: “Invalid Code Signing Entitlements. Your application bundle’s signature contains code signing entitlements that are not supported on iOS. Specifically, value ‘ABC123D45E.AppName’ for key ‘application-identifier’ in ‘AppName.app/AppName’ is not supported. This value should be a string starting with your TEAMID, followed by a dor’.’, followed by the bundle identifier.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage).

I decided that I need to provide the complete bundle ID for the Application Name and repeated the process. This time, the error message was:

ERROR ITMS-9000: “Invalid Code Signing Entitlements. Your application bundle’s signature contains code signing entitlements that are not supported on iOS. Specifically, value ‘ABC123D45E.com-companyname-ios-AppName’ for key ‘application-identifier’ in ‘com.companyname.ios.AppName.app/com.companyname.ios.AppName’ is not supported. This value should be a string starting with your TEAMID, followed by a dor’.’, followed by the bundle identifier.” at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage).

Notice the dashes replacing the dots in the bundle ID: ‘com.companyname.ios.AppName’ became ‘com-companyname-ios-AppName’. Which exactly piece of software did that? My guess is that Corona SDK did that in the process of build, but of course I might be wrong. 

What am I supposed to do then to successfully submit my app? I tried to completely remove CFBundleIdentifier from build.settings but that didn’t help either.

Thank you for your attention.

Alex

Okay, I found the solution myself, but there is a substantial breach in Corona documentation which will result in many experienced iOS developers having the same problem again and again. Just check how many questions there are in this forum with “invalid code signing entitlements”. The reason is that the existing Corona documentation doesn’t explain things clearly enough.

Here is the main thing:

YOU SHOULD NEVER USE A WILDCARD APP ID FOR A CORONA APP.

It is quite common in iOS development to use a wildcard app ID, so that the same provisioning profile could be used for many apps. THIS WILL NOT WORK WITH CORONA. 

The reason is that Corona takes the bundle ID from the provisioning profile when building for distribution. This has to be stated explicitly somewhere, it’s a peculiarity of Corona. 

It should be ale clearly explained that CFBundleIdentifier is not needed in build.settings. An experienced iOS developer will make sure it’s there, but as my issue reported above demonstrates, this one is not used by Corona properly. I left it in place when making the latest build, and it was submitted successfully. However I am sure that removing it completely would work just fine either. This is why this crucial plist element is never mentioned in Corona documentation.

Hope this helps.

Hi @sundraw3,

In the following guide, would you like me to specify this? If so, under which section? I’m happy to do so if you feel it will help.

http://docs.coronalabs.com/guide/distribution/iOSBuild/index.html

Thanks,

Brent Sorrentino

Thanks Brent.

I would suggest adding a highlighted box at the very top saying something like this:

If you are already familiar with provisioning, read this:

  1. Do not use a wildcard app ID with Corona apps. Always use an explicit one.

  2. Do not use CFBundleIdentifier in the iphone/plist section of build.settings. Corona will take the bundle ID from the provisioning profile.

That would be helpful. I only glanced over this guide as it is explaining something I already know. I wouldn’t be able to follow it precisely even if I wanted to do that, as I already have all the certificates in place, and a bunch of provisioning profiles linked to them. But I would pay attention to a highlighted information at the top of the guide.

Alexander Kolesnikov

While we are on this, there is another Corona-specific gotcha which I think isn’t properly documented. I was able to figure it out by searching the forums. 

It’s about the app label in the Android manifest. The trick is to put whatever you want to have for that label into the Application Name field when making an Android build. So if I want to have the label in Russian, I put it there, and the resulting APK file will have that name too. To install it on a device, I then rename the file. This is just a little bit clumsy but isn’t a problem once you know the trick. 

It would be great if it was clearly explained somewhere.

I do suggest, going ahead, to use build.settings as a source of both bundle ID for iOS and app label for Android, in a future version of Corona SDK. That would just make more sense for experienced people coming to Corona from native platforms.

Thanks,

AK

Okay, I found the solution myself, but there is a substantial breach in Corona documentation which will result in many experienced iOS developers having the same problem again and again. Just check how many questions there are in this forum with “invalid code signing entitlements”. The reason is that the existing Corona documentation doesn’t explain things clearly enough.

Here is the main thing:

YOU SHOULD NEVER USE A WILDCARD APP ID FOR A CORONA APP.

It is quite common in iOS development to use a wildcard app ID, so that the same provisioning profile could be used for many apps. THIS WILL NOT WORK WITH CORONA. 

The reason is that Corona takes the bundle ID from the provisioning profile when building for distribution. This has to be stated explicitly somewhere, it’s a peculiarity of Corona. 

It should be ale clearly explained that CFBundleIdentifier is not needed in build.settings. An experienced iOS developer will make sure it’s there, but as my issue reported above demonstrates, this one is not used by Corona properly. I left it in place when making the latest build, and it was submitted successfully. However I am sure that removing it completely would work just fine either. This is why this crucial plist element is never mentioned in Corona documentation.

Hope this helps.

Hi @sundraw3,

In the following guide, would you like me to specify this? If so, under which section? I’m happy to do so if you feel it will help.

http://docs.coronalabs.com/guide/distribution/iOSBuild/index.html

Thanks,

Brent Sorrentino

Thanks Brent.

I would suggest adding a highlighted box at the very top saying something like this:

If you are already familiar with provisioning, read this:

  1. Do not use a wildcard app ID with Corona apps. Always use an explicit one.

  2. Do not use CFBundleIdentifier in the iphone/plist section of build.settings. Corona will take the bundle ID from the provisioning profile.

That would be helpful. I only glanced over this guide as it is explaining something I already know. I wouldn’t be able to follow it precisely even if I wanted to do that, as I already have all the certificates in place, and a bunch of provisioning profiles linked to them. But I would pay attention to a highlighted information at the top of the guide.

Alexander Kolesnikov

While we are on this, there is another Corona-specific gotcha which I think isn’t properly documented. I was able to figure it out by searching the forums. 

It’s about the app label in the Android manifest. The trick is to put whatever you want to have for that label into the Application Name field when making an Android build. So if I want to have the label in Russian, I put it there, and the resulting APK file will have that name too. To install it on a device, I then rename the file. This is just a little bit clumsy but isn’t a problem once you know the trick. 

It would be great if it was clearly explained somewhere.

I do suggest, going ahead, to use build.settings as a source of both bundle ID for iOS and app label for Android, in a future version of Corona SDK. That would just make more sense for experienced people coming to Corona from native platforms.

Thanks,

AK