Skip to content

Commit 2f1722a

Browse files
fix: offset Codemagic build numbers to exceed previous uploads
Previous iOS builds uploaded as build 123. Codemagic's PROJECT_BUILD_NUMBER resets per-project (currently ~72), causing Apple to reject uploads with lower build numbers. Adding +200 offset ensures monotonic increase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e7eaff0 commit 2f1722a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

codemagic.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ workflows:
9393
EOF
9494
- name: Build Android App Bundle
9595
script: |
96+
BUILD_NUM=$((PROJECT_BUILD_NUMBER + 200))
9697
flutter build appbundle \
9798
--release \
98-
--build-number=$PROJECT_BUILD_NUMBER
99+
--build-number=$BUILD_NUM
99100
artifacts:
100101
- build/app/outputs/bundle/release/*.aab
101102
- build/app/outputs/mapping/release/mapping.txt
@@ -154,9 +155,12 @@ workflows:
154155
xcode-project use-profiles
155156
- name: Build IPA
156157
script: |
158+
# Build number must be higher than previous upload (123).
159+
# Use Codemagic build index + 200 offset to ensure monotonic increase.
160+
BUILD_NUM=$((PROJECT_BUILD_NUMBER + 200))
157161
flutter build ipa \
158162
--release \
159-
--build-number=$PROJECT_BUILD_NUMBER \
163+
--build-number=$BUILD_NUM \
160164
--export-options-plist=/Users/builder/export_options.plist
161165
artifacts:
162166
- build/ios/ipa/*.ipa

0 commit comments

Comments
 (0)