Inability to Specify Bundle Version for iOS

  • 2
  • Idea
  • Updated 6 years ago
  • Implemented
In iTunes, my version number is 1.0.0 and my build number is 515. I recently switched to PhoneGap Build and now I can not submit to iTunes:

"This bundle is invalid. The value for key CFBundleVersion [1.0.1] in the Info.plist file must contain a higher version than that of the previously uploaded version [515]."

I tried changing the version number to 6.0.0 but no luck. I haven't changing my version number to 516 and would prefer to avoid that.

PhoneGap Build: we need the "Bundle version" key exposed in the config file!
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
  • frustrated

Posted 7 years ago

  • 2
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hi John

I have created an enhancement request for this at our issue tracker. Kindly bookmark / watch for status update.

https://github.com/phonegap/build/iss...

Thanks
Photo of Brett

Brett, OFFICIAL REP

  • 547 Posts
  • 54 Reply Likes
hey john,

the CFBundleVersion is populated from the "version" attribute in the widget tag. it's value is passed as is to the plist.
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
Yes but version number and build number do not necessarily coincide. In my case I would have to change my version number from 1.0.0 to 517 which I would prefer to avoid.
Photo of Brett

Brett, OFFICIAL REP

  • 547 Posts
  • 54 Reply Likes
what's build number, where is that specified?
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
From Apple's "Information Property List Key Reference" (https://developer.apple.com/library/i...):

CFBundleShortVersionString “Bundle versions string, short” The release-version-number string for the bundle.
CFBundleVersion “Bundle version” The build-version-number string for the bundle.
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
Even if I change my version number to 516 I get:

ERROR ITMS-9000: "This bundle is invalid. The value for key CFBundleVersion [1.0.0] in the Info.plist file must contain a higher version than that of the previously uploaded version [515]." at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
I finally found a work around for my situation using these resources:
* Codesign: https://coderwall.com/p/cea3fw
* Shell script: http://stackoverflow.com/questions/65...
* Entitlements: http://stackoverflow.com/questions/19...

Here's what I did:

  1. Download the IPA file

  2. unzip YourApp.ipa

  3. Click on Payload/YourApp.app and "Expand Package Contents". Then open the info.plist file in XCode.


    1. Edit the "Bundle version" key. It must by greater than the previous version (ex. 516).

    2. Add the "Bundle versions string, short" and set to the version number (ex. 1.0.0).

    3. Save and close.


  4. Download the Distribution Provisioning file from Apple and save in same directory as the ipa file

  5. Resign the package


    1. rm -rf Payload/MyApp.app/_CodeSignature/

    2. cp YourFileName.mobileprovision Payload/YourApp.app/embedded.mobileprovision

    3. codesign -f -s "iPhone Distribution: YOUR_FILE_NAME" --resource-rules Payload/YourApp.app/ResourceRules.plist --entitlements Entitlements.plist Payload/YourApp.app

    4. zip -qr YourApp.ipa Payload/


  6. Upload to Apple...

Photo of Brett

Brett, OFFICIAL REP

  • 547 Posts
  • 54 Reply Likes
Photo of Jin Keat Saw

Jin Keat Saw

  • 1 Post
  • 0 Reply Likes
I am having similar issue, but i solve with the following.
Hope it helps everybody.

PhoneGap version: 3.1.0

In PhoneGap config.xml
----------------------------
version = "1.0.1"
versionCode = "2"

At 1st I was changing only version to 1.0.1, after failed I tried changing versionCode from 1 to 2, and now is success.
Photo of John Scott

John Scott

  • 13 Posts
  • 0 Reply Likes
Pretty sure versionCode is only relevant to Android. Brett's post above (https://github.com/phonegap/build/iss...) seems to be the best solution. It worked well for me anyway. Wish I'd know about it before slogging through manual solution I posted.
Photo of Scott Bolinger

Scott Bolinger

  • 16 Posts
  • 2 Reply Likes
Yep, confirmed the config.xml value works. Here's the code I used:

<gap:config-file platform="ios" parent="CFBundleVersion"><string>656</string></gap:config-file>
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Idea implemented. Closing

This conversation is no longer open for comments or replies.