我在尝试从 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
任何帮助,将不胜感激