eas build fails with Android build

My problem right now is that im trying to development build my app. unfortunately im getting an error in the “run expo doctor” section and in the Prebuild section of my builds. But in my local files in VScode every check works. It seems like that the expo build cant find my splash.png, icon.png and adaptive-icon.png. But if i run it in Expo-Go or Android Emulator eveything works fine. i dont understand whats going on here all files seems to be in the right folder.

all Errors are below.

i appreciate all responses.

my app.json file where the errors occur:

"splash": {
  "image": "./assets/splash.png",
  "resizeMode": "contain",
  "backgroundColor": "#0b0b0b"
},

"android": {
  "adaptiveIcon": {
    "foregroundImage": "./assets/adaptive-icon.png",
    "backgroundColor": "#ffffff"
  },

"expo": {
    "icon": "./assets/icon.png"
 },

Expo Build Error:

[stderr] 

Error: Problem validating asset fields in app.json. Learn more: https://docs.expo.dev/

[stderr] 

 • Field: Android.adaptiveIcon.foregroundImage - cannot access file at './assets/adaptive-icon.png'.

[stderr] 

 • Field: Splash.image - cannot access file at './assets/splash.png'.

[stderr] 

 • Field: icon - cannot access file at './assets/icon.png'.

[stderr] 

One or more checks failed, indicating possible issues with the project.


Command "expo doctor" failed.
npx -y expo-doctor exited with non-zero code: 1

npx expo-doctor in VScode:

WARNING: We recommend using PowerShell or Bash via WSL 2 for development with Expo CLI on Windows. You may encounter issues using cmd.exe.

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Prebuild Errors in Expo:

✖ Config sync failed

[stderr] 

Error: [android.dangerous]: withAndroidDangerousBaseMod: ENOENT: no such file or directory, open './assets/adaptive-icon.png'

[stderr] 

Error: [android.dangerous]: withAndroidDangerousBaseMod: ENOENT: no such file or directory, open './assets/adaptive-icon.png'

[stderr] 

    at Object.openSync (node:fs:590:3)

[stderr] 

    at readFileSync (node:fs:458:35)

[stderr] 

    at calculateHash (/home/expo/workingdir/build/node_modules/@expo/image-utils/build/Cache.js:14:91)

[stderr] 

    at createCacheKey (/home/expo/workingdir/build/node_modules/@expo/image-utils/build/Cache.js:19:18)

[stderr] 

    at Object.createCacheKeyWithDirectoryAsync (/home/expo/workingdir/build/node_modules/@expo/image-utils/build/Cache.js:24:33)

[stderr] 

    at generateImageAsync (/home/expo/workingdir/build/node_modules/@expo/image-utils/build/Image.js:151:34)

[stderr] 

    at async generateIconAsync (/home/expo/workingdir/build/node_modules/@expo/prebuild-config/build/plugins/icons/withAndroidIcons.js:350:11)

[stderr] 

    at async /home/expo/workingdir/build/node_modules/@expo/prebuild-config/build/plugins/icons/withAndroidIcons.js:278:21

[stderr] 

    at async Promise.all (index 0)

[stderr] 

    at async generateMultiLayerImageAsync (/home/expo/workingdir/build/node_modules/@expo/prebuild-config/build/plugins/icons/withAndroidIcons.js:274:3)

Error: Unknown error. See logs of the Prebuild build phase for more information.

I tryed to change the path of all .png and even changed the .png to the original .png from expo.

Hi ,Have you solved this problem?

Hi @butros55

It looks like you do not have a file called adaptive-icon.png in the assets directory in your app. Also splash.png and icon.png.

If this happens on the build servers, but not locally, then I can think of a couple of possible reasons:

  • Windows has a case-insensitive filesystem. If the files in the repository have e.g. uppercase letters, but in app.json they’re all lowercase, then it would cause this sort of problem when it tries to build on the Linux build servers
  • If you have these images in .gitignore or .easignore for some reason, then they would not be uploaded to the build server