ReactNativeUtil
ReactNativeUtil copied to clipboard
React native 打包Android时报错
执行cd android && ./gradlew assembleRelease任务错误
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command 'node''
或者
What went wrong:
Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
> A problem occurred starting process 'command 'node''
第一种可能: 这个错误的可能原因是gradle deamon的缓存问题,关掉cradle deamon,重新再执行一次就可以解决。 $ ./gradlew --stop
第二种方式: 在项目/app/build.gradle里面配置如下: 找到project.ext.react 然后
project.ext.react = [
entryFile: "index.js",
nodeExecutableAndArgs : ["/usr/local/bin/node"]//添加node路径
]
如果遇到
Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error:
在项目的gradle.properties中:设置android.enableAapt2=false
添加之后 还是报相同的错 请问能得到小伙伴的帮助