React-Native打包 Execution failed for task ':app:bundleReleaseJsAndAssets'. > Process 'command 'c...

错误内容

/*最开始打包报错*/
Execution failed for task ':app:bundleReleaseJsAndAssets'.
 Process 'command 'cmd'' finished with non-zero exit value 1
* Try:Run with --stacktrace option to get the stack trace. 
Run with --info or --debug option to get more log output.


/*解决上一个问题后,再次报错*/
 unable to process incoming event 'ProcessComplete' (ProgressCompleteEvent)

1. 发生的原因

我手里的项目是从别人手里接过来的,而上一个开发者用的开发设备是mac,我的是win。在配置信息上会有一些不同。

2. 出问题的点

React-Native打包 Execution failed for task ':app:bundleReleaseJsAndAssets'. > Process 'command 'c..._第1张图片
image.png
位置1是mac用的。位置2是win用的。。。
//.........\android\app\build.gradle
//代码贴一下
project.ext.react = [
    entryFile: "index.js",
//    nodeExecutableAndArgs: ["/usr/local/bin/node"],
    cliPath:"node_modules/react-native/local-cli/cli.js"

3. 配置之后运行打包语句

cd android
gradlew.bat assembleRelease --console plain

注: 如果直接运行
cd android
gradlew assembleRelease
可能会报错 unable to process incoming event 'ProcessComplete' (ProgressCompleteEvent)

你可能感兴趣的:(React-Native打包 Execution failed for task ':app:bundleReleaseJsAndAssets'. > Process 'command 'c...)