【问题标题】:I am trying to make an apk its generated but with this error Execution failed for task ':app:bundleReleaseJsAndAssets'我正在尝试生成一个 apk,但出现此错误任务':app:bundleReleaseJsAndAssets'的执行失败
【发布时间】:2019-10-19 06:19:51
【问题描述】:

任务:app:bundleReleaseJsAndAssets 扫描 C:\react-native\first_app\node_modules 中的符号链接文件夹(109 毫秒) 扫描文件夹中的符号链接 C:\react-native\first_app\node_modules (47ms) 警告:转换缓存已重置。 加载依赖图,完成。

无法从 C:\react-native\first_app\node_modules\react-native\Libraries\react-native\react-native-implementation.js 解析模块 AccessibilityInfo:模块 AccessibilityInfo 在 Haste 模块映射中不存在

这可能与https://github.com/facebook/react-native/issues/4968有关 要解决,请尝试以下操作: 1.清除守望者手表:watchman watch-del-all。 2、删除node_modules文件夹:rm -rf node_modules && npm install。 3. 重置 Metro Bundler 缓存:rm -rf /tmp/metro-bundler-cache-*npm start -- --reset-cache。 4. 移除急速缓存:rm -rf /tmp/haste-map-react-native-packager-*.

FAILURE:构建失败并出现异常。

  • 出了什么问题: 任务 ':app:bundleReleaseJsAndAssets' 执行失败。

    进程 'command 'cmd'' 以非零退出值 1 结束

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

  • 通过https://help.gradle.org获得更多帮助

在 42 秒内构建失败 12 个可操作的任务:1 个已执行,11 个是最新的

【问题讨论】:

  • app 是用这个 gradlew assembleRelease -x bundleReleaseJsAndAssets 生成的,有人帮忙,我正在使用 Windows 10
  • 你能告诉我你使用的是什么版本的 React-Native 吗?
  • react-native-cli: 2.0.1 react-native: 0.56.0
  • 我也试过这个 react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output App/src/main/assets/index. android.bundle --assets-dest App/src/main/res/ 命令bundle 无法识别。确保你已经运行 npm install 并且你在一个 react-native 项目中。
  • 有人请帮忙

标签: windows react-native react-native-android


【解决方案1】:

here 所述,这可能是因为您没有正确捆绑Android。

您可以添加以下脚本 "bundle-android": "node node_modules/react-native/local-cli/cli.js 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/"

进入你的package.jsonscripts

然后运行npm run bundle-android

然后尝试在项目的android 目录中运行gradlew assembleRelease -x bundleReleaseJsAndAssets。希望它能解决你的问题。

【讨论】:

  • BUNDLE [android, dev] ./index.js ▓░░░░░░░░░░░░░░░ 6.3% (1/4),失败。在此之后没有错误。
  • 错误:捆绑失败:错误:无法从C:\react-native\first_app\node_modules\react-native\Libraries\react-native\react-native-implementation.js 解析模块AccessibilityInfo:模块AccessibilityInfo 在Haste 模块映射中不存在此错误出现在捆绑开始之前。
  • BUNDLE [android, dev] ./index.js ▓░░░░░░░░░░░░░░░ 6.3% (1/4),失败。 cmd卡在这个我不知道
  • 你能关注this thread这个AccessibilityInfo问题吗
  • 如果你能和我分享你的package.json,那就太好了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-19
  • 1970-01-01
  • 2016-10-19
  • 2015-07-23
相关资源
最近更新 更多