gpt4 book ai didi

Error: Problem validating asset fields in app.json in Expo Builder(错误:在EXPO Builder中验证app.json中的资产字段时出现问题)

转载 作者:bug小助手 更新时间:2023-10-26 20:07:17 29 4
gpt4 key购买 nike



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.

我现在的问题是,我正在尝试开发构建我的应用程序。不幸的是,我在“运行EXPO医生”部分和我的构建的预构建部分得到了一个错误。但在我的VScode本地文件中,每个检查都有效。似乎EXPO版本找不到我的plash.png、icon.png和Adaptive-ic.png。但如果我在EXPO-GO或Android Emulator上运行它,一切都很好。我不明白这是怎么回事,所有的文件似乎都放在正确的文件夹里。


all Errors are below.

所有错误都在下面。


i appreciate all responses.

我感谢所有的回复。


my app.json file where the errors occur:

发生错误的我的app.json文件:


"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:

Expo构建错误:


[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:

NPX EXPO-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.

我试着更改了所有.png的路径,甚至将EXPO中的.png更改为原始的.png。


更多回答
优秀答案推荐

take a look at the gitignore and make sure you don't have the png files in it.

看一看gitignore,并确保其中没有PNG文件。


更多回答

Thanks for the answer. i created a new project and just installed the reqired packages and it worked.

谢谢你的回答。我创建了一个新项目,只需安装所需的包,它就起作用了。

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com