エラー内容
fastlane で increment_build_number
を使ったら以下のようにエラーが出て increment されなかった。
[14:33:08]: ------------------------------------ [14:33:08]: --- Step: increment_build_number --- [14:33:08]: ------------------------------------ [14:33:08]: $ cd /Users/kensuke/Documents/xcode/hoge && agvtool next-version -all && cd - [14:33:09]: ▸ Setting version of project hoge to: [14:33:09]: ▸ 5. [14:33:09]: ▸ Also setting CFBundleVersion key (assuming it exists) [14:33:09]: ▸ Updating CFBundleVersion in Info.plist(s)... [14:33:09]: ▸ $(SRCROOT)/hoge/SupportingFiles/appStaging.plist [14:33:09]: ▸ Cannot find "$(SRCROOT)/hoge/SupportingFiles/appStaging.plist" [14:33:09]: ▸ $(SRCROOT)/hoge/SupportingFiles/appDev.plist [14:33:09]: ▸ Cannot find "$(SRCROOT)/hoge/SupportingFiles/appDev.plist" [14:33:09]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../appTests/Info.plist" to 5 [14:33:09]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../hoge/SupportingFiles/Info.plist" to 5
発生状況
TARGETS を app, appStaging, appDev, appTests のように分離していて、 Info.plist が 4 つできている状態になっていた。
対処法
Xcode で ⌘ + Shift + f
を押して INFOPLIST_FILE
で検索する。
そうすると $(SRCROOT)/hoge/SupportingFiles/appStaging.plist
などと書いてあるところが出てくるので、そこの $(SRCROOT)/
を削除する。
hoge/SupportingFiles/appStaging.plist
なるようにする。
結果
[14:41:41]: ------------------------------------ [14:41:41]: --- Step: increment_build_number --- [14:41:41]: ------------------------------------ [14:41:41]: $ cd /Users/kensuke/Documents/xcode/hoge && agvtool next-version -all && cd - [14:41:42]: ▸ Setting version of project hoge to: [14:41:42]: ▸ 6. [14:41:42]: ▸ Also setting CFBundleVersion key (assuming it exists) [14:41:42]: ▸ Updating CFBundleVersion in Info.plist(s)... [14:41:42]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../appTests/Info.plist" to 6 [14:41:42]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../hoge/SupportingFiles/Info.plist" to 6 [14:41:42]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../hoge/SupportingFiles/appStaging.plist" to 6 [14:41:42]: ▸ Updated CFBundleVersion in "hoge.xcodeproj/../hoge/SupportingFiles/appDev.plist" to 6
参考
fastlane cannot update project version · Issue #329 · fastlane/fastlane