Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native 打包Android时报错 #19

Open
wuyunqiang opened this issue Nov 28, 2017 · 1 comment
Open

React native 打包Android时报错 #19

wuyunqiang opened this issue Nov 28, 2017 · 1 comment

Comments

@wuyunqiang
Copy link
Owner

wuyunqiang commented Nov 28, 2017

执行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

@wanxchao
Copy link

wanxchao commented Jun 5, 2019

添加之后 还是报相同的错 请问能得到小伙伴的帮助

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants