Bug 44694 - CFBundleVersion not being output into the archived IPA
Summary: CFBundleVersion not being output into the archived IPA
Status: RESOLVED DUPLICATE of bug 44348
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: --- blocker
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-23 17:39 UTC by brock
Modified: 2016-11-11 23:38 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 44348

Description brock 2016-09-23 17:39:57 UTC
# Steps to reproduce
Build an iOS project with a CFBundleVersion value in the plist

# Expected behavior
The archived app contains the CFBundleVersion

# Actual behavior
No CFBundleVersion

# Supplemental info (logs, images, videos)


# Test environment (full version information)
=== Xamarin Studio Business ===

Version 6.1 (build 5441)
Installation UUID: 64f3fa95-d0c1-48f2-ae9a-dc11e6160c90
Runtime:
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Version: 0.33.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.iOS ===

Version: 10.0.0.6 (Xamarin Business)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Xamarin.Android ===

Version: 7.0.0.18 (Xamarin Business)
Android SDK: /Users/brockbr/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 23.0.3

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.10.0.99 (Xamarin Business)

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.11.5
Darwin Brocks-MacBook-Pro.local 15.5.0 Darwin Kernel Version 15.5.0
    Tue Apr 19 18:36:36 PDT 2016
    root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
Comment 1 Xavier P 2016-09-24 07:21:05 UTC
Bug confirmed. Workaround is to manually add it after archiving the binary but before signing it for distribution to App Store (e.g.):

/usr/libexec/PlistBuddy -c "Add :ApplicationProperties:CFBundleVersion string '2.3.0.0'" \
~/Library/Developer/Xcode/Archives/2016-09-21/MyProject.iOS\ 9-21-16\ 10.58\ AM.xcarchive/Info.plist
Comment 2 Vincent Dondain [MSFT] 2016-09-30 13:33:24 UTC
Hi,

If I try with a brand new iOS project.

In the project options > iOS IPA Options > Build iTunes Package Archive (IPA).

Then in the build folder, unzip the .ipa file, open Payload and inspect the built app, I **do** have the CFBundleVersion and CFBundleShortVersionString from the main app's Info.plist file.

Therefore I cannot confirm this bug.

I'm using Xamarin Studio Version 6.2 (build 586) and Xamarin.iOS Version: 10.0.1.8

Could you please re-try with the latest versions of the product (stable) as well as give us a test case if you still cannot solve the issue. That might help us reproduce or at least get closer to your environment and understand what's wrong.
Comment 3 brock 2016-10-12 15:45:02 UTC
Further steps to reproduce:

(Note - I have updated to current Stable)

1) Create new SingleView iOS Project
2) In the Info.plist, change Bundle version to 1234567
3) Change to Release/Device configuration
4) In project settings, set signing to a cert that works
5) Select Build->Archive for Publishing
6) In the Archives window, observe that "Code" is not set
	Expect - Code to be set to 1234567
	Actual - Blank Code

7) Right click the archive fro the Archives window, and Reveal in Finder
8) From finder, right click the .xcarchive and Show Package Contents.
	Expect - CFBundleVersion to be included with a value of 1234567
	Actual - No CFBundleVersion
Comment 4 Vincent Dondain [MSFT] 2016-10-14 16:30:03 UTC
Ah thanks for the complete test case, I did not check the publishing workflow since you talked about IPA.

Now I can confirm the issue.
Comment 5 Vincent Dondain [MSFT] 2016-10-14 16:43:36 UTC
Actually this bug has already been fixed by Jeff in https://github.com/xamarin/xamarin-macios/commit/f9e2e187940e1815e648e65d4d6fb2ab50d3c9a9

It's also a duplicate of https://bugzilla.xamarin.com/show_bug.cgi?id=44348

If you don't want to wait for the fix to hit stable, you can check out our xamarin-macios wiki here: https://github.com/xamarin/xamarin-macios/wiki
There are links to our continuous builds, what you want is in master.

*** This bug has been marked as a duplicate of bug 44348 ***
Comment 6 Brad Moore 2016-11-11 23:11:55 UTC
If this was merged into master on Sept 16th, and latest Xamarin.iOS was built on Sept 25th why isn't this fixed in latest stable? (XS 6.1.1. build 17, Xamarin.iOS 10.2.0.4) Is a stable build not a snapshot of the current master branch?
Comment 7 Brad Moore 2016-11-11 23:38:47 UTC
Just updated to XS 6.1.2 (build 44) and Xamarin.iOS 10.2.1.5 (what are the chances that the day I make a comment and then launch XS is the day there is an update!), but appears to still be broken when I did a full rebuild and archive of our project. 

Though the comment over here, https://bugzilla.xamarin.com/show_bug.cgi?id=44348#c7, seems to imply that it is fixed in XS 6.2.0.619 Xamarin.iOS 10.1.0.82. Which is odd, is a newer XS, and old Xamarin.iOS than my current and it still does not appear for me. 

Updating to alpha channel (XS 6.2, Xamarin.iOS 10.4.0.4), and then my archive build code worked.