SiarheiFedartsou / fastlane-plugin-versioning

Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.
MIT License
509 stars 61 forks source link

New error: invalid parameters when specifying `build_number` #76

Closed nickfourtimes closed 1 year ago

nickfourtimes commented 1 year ago

Up until this past week or so, _increment_build_number_inplist has been working well. However, in the past few days I'm getting the following errors when attempting to increment:

[19:20:44]: --------------------------------------------
[19:20:44]: --- Step: latest_testflight_build_number ---
[19:20:44]: --------------------------------------------
[19:20:44]: Login to App Store Connect (USER_EMAIL)
[19:20:46]: Login successful
[19:20:50]: Fetching the latest build number for any version
[19:20:52]: Latest upload for version 0.6 on ios platform is build: 9
[19:20:52]: You passed invalid parameters to 'increment_build_number_in_plist'.
[19:20:52]: Check out the error below and available options by running `fastlane action increment_build_number_in_plist`
[19:20:52]: Failure incrementing build number, using project base value.

I haven't changed my fastlane actions in the interim; these are the relevant lines of code (simplified slightly):

latest_tf = latest_testflight_build_number(
    platform: options[:platform]
)
build_num = latest_tf + CUSTOM_VAL
increment_build_number_in_plist({
    build_number: build_num,
    xcodeproj: proj
})

I've confirmed that build_num does get set to a valid integer. If I comment out the build_number parameter, then the command seems to work, though obviously it doesn't apply the desired custom build number, which is required in our CI/CD system.

I'm wondering if maybe this was just an update to Xcode & its agvtool that may have caused this error.

nickfourtimes commented 1 year ago

So after some head-scratching & panicked testing, it seems like the build_number parameter requires a string value. Changing the command to the following worked:

increment_build_number_in_plist({
    build_number: build_num.to_s,
    xcodeproj: proj
})

I don't think this is documented anywhere, and it feels a little counter-intuitive, but at least it's resolved.