gpt4 book ai didi

react-native - 错误 : bundling failed: Invariant Violation: invalid asset resolution

转载 作者:行者123 更新时间:2023-12-04 05:13:35 26 4
gpt4 key购买 nike

我在尝试从 Android 设备 (1+ 5t) 加载应用程序时得到这个

error: bundling failed: Invariant Violation: invalid asset resolution
at invariant (~/project/node_modules/metro/node_modules/fbjs/lib/invariant.js:40:15)
at ModuleResolver._getFileResolvedModule (~/project/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:175:9)
at ModuleResolver.resolveDependency (~/project/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:116:19)
at ResolutionRequest.resolveDependency (~/project/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:49:18)
at DependencyGraph.resolveDependency (~/project/node_modules/metro/src/node-haste/DependencyGraph.js:218:16)
at Object.resolve (~/project/node_modules/metro/src/lib/transformHelpers.js:141:30)
at dependencies.map.result (~/project/node_modules/metro/src/DeltaBundler/traverseDependencies.js:373:31)
at Array.map (<anonymous>)
at resolveDependencies (~/project/node_modules/metro/src/DeltaBundler/traverseDependencies.js:369:18)
at ~/project/node_modules/metro/src/DeltaBundler/traverseDependencies.js:188:33
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

尝试:
- react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
- react-native start --reset-cache
- rm -rf node_module & yarn install

and this - didnt work

任何帮助,将不胜感激

最佳答案

修复:删除“.ios.”出于图像名称
由于我的应用程序目前仅适用于 ios,因此我在某些图像名称(例如“welcome@2.ios.png”)中有一些剩余部分 - 因此在 android 上运行时,react native 找不到任何资源

关于react-native - 错误 : bundling failed: Invariant Violation: invalid asset resolution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56171585/

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