Fastlane deliver截图尺寸不兼容报错:原因排查与方案咨询
Let's break down your problem and walk through actionable fixes step by step:
Core Issue
The root cause isn't Apple's size requirements or GitLab CI—it's your Frameit configuration. Here's why:
- Your
Framefile.jsonuses a custombackgroundandpaddingsetting, plusshow_complete_frame: false. This tells Frameit to embed the raw 1242×2208 snapshot into a larger custom background with extra padding, resulting in the 1446×2948 image that Apple rejects. - Since you mentioned this started after updating versions, it's likely a minor change in Frameit's background compositing logic pushed the final size just over what Apple accepts.
GitLab CI doesn't alter screenshot sizes on its own, but you do need to make sure your CI environment matches your local setup (same Xcode 10.2, same Fastlane version) to avoid unexpected differences.
Step-by-Step Solutions
1. Adjust Frameit to Generate App Store-Compliant Screenshots
Choose the option that fits your needs:
Option A: Keep Official Device Frames (No Custom Background)
Modify your Framefile.json to remove the custom background/padding and enable Apple's official device frames. This will generate screenshots in sizes Apple accepts:
{ "device_frame_version": "latest", "default": { "keyword": { "fonts": [ { "font": "./fonts/SF-UI-Display-Semibold.otf", "supported": ["de-DE", "en-US"] }, { "font": "./fonts/Chinese.ttf", "supported": ["zcmn-Hans"] } ] }, "title": { "fonts": [ { "font": "./fonts/SF-UI-Display-Regular.otf", "supported": ["de-DE", "en-US"] }, { "font": "./fonts/Chinese.ttf", "supported": ["zcmn-Hans"] } ], "color": "#203943" }, // Remove custom background and padding "stack_title" : false, "title_below_image": false, "show_complete_frame": true, // Enable official device frames }, "data": [ { "filter": "01", "keyword": { "color": "#4B849B" } }, { "filter": "02", "keyword": { "color": "#4B849B" } }, { "filter": "03", "keyword": { "color": "#4B849B" } }, { "filter": "04", "keyword": { "color": "#4B849B" } }, { "filter": "05", "keyword": { "color": "#4B849B" } }, { "filter": "06", "keyword": { "color": "#4B849B" } } ] }
Option B: Use Raw Screenshots (No Frames at All)
If you don't need device frames, just remove the Frameit step entirely from your Fastfile. The raw snapshots from Snapshot are already in Apple's required native resolutions:
lane :screenshots do snapshot # Remove the frameit line here end
2. Ensure GitLab CI Environment Matches Your Local Setup
- Lock Xcode version: In your GitLab CI config, add a step to switch to Xcode 10.2 with
xcode-select -s /Applications/Xcode_10.2.app(adjust the path to match your runner's setup). - Pin Fastlane version: In your
Gemfile, specify the exact Fastlane version you use locally (e.g.,gem "fastlane", "~> 2.133.0"), then runbundle installin CI to avoid version mismatches.
3. Do You Need to Change Devices in Snapfile?
No—your current devices (iPhone 8 Plus, iPhone SE) are fully compatible with iOS 12.2 and App Store requirements. The issue is Frameit's processing, not the devices themselves. If you want to add more devices later, stick to ones supported by Xcode 10.2 (like iPhone X, iPhone XS) and keep your Frameit configuration consistent.
Test First!
Before pushing to CI, run fastlane screenshots locally and check the output screenshot sizes:
- iPhone 8 Plus: 1242×2208 (raw) or official frame-compliant size
- iPhone SE: 640×1136 (raw) or official frame-compliant size
Once local tests pass, your GitLab CI run should work too.
内容的提问来源于stack exchange,提问作者iKK

