Fastlane frameit unsupported screen size when deliver to App store

1.7k Views Asked by At

Using Swift5, iOS-12.2, Xcode-10.2(10E125) and running everything with a GitLab CI,

There seem to be an issue with screenshot screen sizes during App release step (using Fastlane's deliver). The screenshots are created nicely (with Fastlane's snapshot and frameit tools).

But having updated to newest iOS-, Swift- and Xcode-versions now suddenly breaks my working example of Fastlane. I now get the following error:

Unsupported screen size [1446, 2948] for path '/Users/user/Documents/Programieren/iPhone_applications/Learning/Watch/MyApp/builds/aMDc3etB/0/myusername/MyAppName/fastlane/screenshots/de-DE/iPhone 8 Plus-01Screenshot_de_framed.png'

Could there be something wrong with Fastlane:

  • either at the frameit step (since framed images are bigger in size than what snapshot created)
  • or at the App release step (since maybe Apple changed something with the screen sizes accepted).

I am wondering if the fact that I run everything with GitLab CI has an influence (but it should't). What could be the cause of the Fastlane failure concerning screen sizes of screenshots at the deliver step ?

For an iPhone8-Plus example - what I realised:

--> screenshots after Fastlane snapshot step are [1242 × 2208] pixels in size

--> framed-screenshots after the Fastlane frameit step are [1446 × 2948] pixels in size

The Apple app store asks for [1242 × 2208] pixel sized images - therefore "framed" ones will never be accepted !!

Could there be something wrong with frameit ???

Should I choose different iOS devices in my Snapfile (see below) ? And if yes, which ones ??? (i.e. it used to be the case that the App store needed an iPhone8 Plus sized screenshot [5.5"]. Did that change maybe ??)

Here is my Fastfile:

lane :screenshots do
    snapshot
    frameit(silver: true, path: './fastlane/screenshots')
end

Here is my Snapfile:

workspace "MyApp.xcworkspace"
scheme "MyAppUITests"
devices([
    "iPhone 8 Plus",
    "iPhone SE"
])
languages([
    "en-US",
    "de-DE"
])
localize_simulator true
clear_previous_screenshots true
erase_simulator true
reinstall_app true

Here is my Framefile.json file:

{
    "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"
        },
        "background": "./background.jpg",
        "padding": 50,
        "stack_title" : false,
        "title_below_image": false,
        "show_complete_frame": false,
    },


    "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"
            }
        }
    ]
}
2

There are 2 best solutions below

0
On

For those who bump into frameit spitting "Unsupported screen size" error, here is a scriptable way to resolve the issue.

  1. Go to this file to check the accepted screen size for all devices.

  2. Use magick to reframe the raw screenshot to the dimension required for the desired device. An example command to resize the screenshot to fit iPhone 12 Pro Max is like this

magick $file -resize "1284x2778"\! $file
  1. After resizing, run frameit.
0
On

Checking the source code of Frameit will find that it only resizes the final image when is_complex_framing_mode.

For is_complex_framing_mode to be true, it needs background and title( or keyword).

Besides, the default value of show_complete_frame is false. I set it to true, too.

I find this way will generate correct size of framed images to submit to App Store Connect.

Here is the Framefile.json

{
    "default": {
        "title": {
            "color": "#0000ff01",
            "text": "."
            },
        "show_complete_frame":true,
        "background": "./background.jpg",
        "padding": 1
        },
    "data": []
}