Not using icon.png location in app.json

SDK Version: 5.2.0
Platforms(Android/iOS/web/all): iOS

Hello,

app.json specifies the below

{
  "expo": {
    "name": "PROJECT_NAME",
    "slug": "PROJECT_NAME",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#FFFFFF"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

Yet running expo start --ios started giving the below error and I am not sure why. The app does run in the iOS simulator as expected.

Error: ENOENT: no such file or directory, scandir '/Users/username/PROJECT_NAME/assets/images'

To troubleshoot, created the assets/images directory and received more details:

Logs for your project will appear below. Press Ctrl+C to exit.
Error: Asset not found: /Users/username/PROJECT_NAME/assets/images/icon.png for platform: null
    at /Users/username/PROJECT_NAME/node_modules/metro/src/Assets.js:215:13
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/username/PROJECT_NAME/node_modules/metro/src/Assets.js:75:24)
    at _next (/Users/username/PROJECT_NAME/node_modules/metro/src/Assets.js:97:9)

Tried troubleshooting with the steps mentioned on these issues to no avail:

  1. Github: Error: ENOENT: no such file or directory, scandir ‘/Users/USER_NAME/PROJECT_NAME/src/assets/images’ #9000

  2. icon.png is missing in assets folder #23

Of course, I can make a copy of the existing icon.png into the assets/images folder although why is that necessary when the correct locations are specified in app.json?

Thanks in advance!

Tom

Hey @djdman2000, can you try clearing your caches and generated dirs?

Hi @adamjnav!

Tried deleting node_modules , package-lock.json and .expo and then using npm install again and starting the app with expo r -c to no avail. Anything else you suggest?

Thanks,

Tom

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