bitrise-steplib / steps-set-xcode-build-number

Sets the Build Number to the specified value in the Info.plist file for the next build
MIT License
7 stars 11 forks source link

Updating CFBundleVersion to match multiple targets #30

Closed raulgordejev closed 11 months ago

raulgordejev commented 1 year ago

Troubleshooting

Issue description

I have two targets in my application. For that I've added two separate 'Set Xcode Project Build Number' steps, with each Info.plist path specified. Goal is to set CFBundleVersion to be $GIT_CLONE_COMMIT_COUNT.

When I look at the logs, I can see the correct commit count number is displayed in both of the steps and the build overall is successful. However, during the next step, where it uploads to app store connect, I receive a ITMS-90473: CFBundleVersion Mismatch warning email saying that the bundle version of my targets is not matching (one is correct, another one is just left as 1). I am confident, that the Info.plist path for each step is correct.

I've spend a lot of hours already trying to figure it out, but no luck. Currently resolved it by just specifying the build numbers manually in the code, but would be great to get it working again in Bitrise.

Any ideas what might be causing this?

Bitrise info

jgonfer commented 1 year ago

Hey @raulgordejev, I was just going to submit a ticket to Support exactly for this same issue. It also happens to my project. I double checked the logs and printed the value of the Info.plist files after they were updated by the "Set Xcode Project Build Number" and I can also see that the values were properly updated with the right values.

I'm also very confused because I changed nothing and I started having this issue yesterday. On April 12th, everything was working fine and the Info.plist files were updated as expected. But at this moment, no matter what I've tried, the build number is always kept with the default value, archived and uploaded to the App Store with the default value (1). So like you, I'm also getting an error message because the build number.

raulgordejev commented 1 year ago

@jgonfer Did you get it resolved by any chance?

ynnadrules commented 1 year ago

I'm experiencing the same issue.

raulgordejev commented 1 year ago

I ended up creating a custom script which I added as a step in my build pipeline:


cd $BITRISE_SOURCE_DIR
#Insert your project path below 
PROJECT=$XCODE_PROJECT_PATH/project.pbxproj
sed -i '' -e 's/CURRENT_PROJECT_VERSION \= [^\;]*\;/CURRENT_PROJECT_VERSION = '$GIT_CLONE_COMMIT_COUNT';/' $PROJECT 
build_number=`sed -n '/CURRENT_PROJECT_VERSION/{s/CURRENT_PROJECT_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' $PROJECT`
tcombs commented 1 year ago

Our team ran into this problem as well. It was fixed by setting "Generate Info.plist file" to "No" for the target in Build Settings > Packaging

download
bitrise-coresteps-bot commented 11 months ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 11 months ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.