Error: Failed to resize image

When I try running expo build:ios, the build fails with the following output:

Cleaning up iOS…
Error: Failed to resize image: AppIcon20x20@2x.png. (Error: Input file contains unsupported image format)
at Promise.all.iconResolutions.map (/usr/local/turtle js/node_modules/@expo/xdl/build/detach/IosIcons.js:173:15)


If I use the default blank icon.png file that is created when creating a new expo project then the build is successful, but if I try to use another .png file with the same dimensions or even copy the image into the default blank icon.png file, I get the above error. Since it works with the default file, this makes me think it isn’t a problem with the “assetBundlePatterns” key in my app.json failing to include the image, which seems to be the response for similar posts on this forum. Any ideas?

Below is my app.json file.
{
“expo”: {
“name”: “Cultures Calendar”,
“slug”: “cultures-calendar”,
“privacy”: “public”,
“sdkVersion”: “33.0.0”,
“platforms”: [
“ios”,
“android”,
“web”
],
“version”: “1.0.2”,
“orientation”: “portrait”,
“icon”: “./assets/icon.png”,
“splash”: {
“image”: “./assets/splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#ffffff
},
“assetBundlePatterns”: [
“assets/*”
],
“updates”: {
“fallbackToCacheTimeout”: 0
},
“ios”: {
“supportsTablet”: true,
“bundleIdentifier”: “com.cal.culturescalendar”,
“infoPlist”: {
“UIBackgroundModes”: [
“location”,
“fetch”
]
}
},
“android”: {
“package”: “com.cal.culturescalendar”
}
}
}

What do you get if you run file /path/to/AppIcon20x20@2x.png in a terminal window?

Try “assets/**” instead of “assets/*”, or better still for testing: “*/**”

Unfortunately I continue to get this error no matter what assetBundlePatterns value I use.

Did you mean **/*?

1 Like

Please run it again on the real path to the file. I just wrote /path/to/ because I don’t know where the file is on your system.

Sorry, I should have realized that.

AppIcon20x20@2x.png shouldn’t be on my local computer. From my understanding, when building using expo, expo locates the icon file (which is specified in app.json) and then creates all the necessary AppIconXX.png images for iOS. Is this correct?

I’m not sure. Perhaps you are right. What do you get if you run file your-app-icon.png then?

I figured out the problem. Initially I was running “exp start --tunnel” in another terminal and using “expo-build ios” to build the app (I’m not sure how I ended up with this combination). But running “expo-cli start” along with “expo-build ios” fixed the problem. Really simple fix, thank you for all the responses though.

Glad you sorted it out :slight_smile:

exp is old. You should be using expo instead these days.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.