Mac 下配置react-native 安卓环境中遇到的坑

在按照官网配置完开发环境后:

第一次 react-native run-android:

Error:Cannot create directory \app\build\intermediates\incremental\packageDebug\zip-cache

原因是:sudo的权限不够

解决办法:https://zhidao.baidu.com/question/1240820068009584939.html?fr=ala&word=osx%2010.11%20sudo&device=mobile&ssid=808c5269736b793333311940&from=0&uid=0&pu=usm@1,sz@320_1001,ta@iphone_2_6.0_3_534&bd_page_type=1&baiduid=2BBE5F36DD5D61C378E3D884A1CE8AC1&tj=zhidao_2_0_10_l1


第二次:

java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.


解决办法:

在工程的根目录下的android文件下新建一个local.properties的文件,然后编辑上:

sdk.dir = /Users/。。。/Library/Android/sdk

第三次:

Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.


解决办法:详见 http://blog.csdn.net/happy2048/article/details/63684200


至此终于完成Mac下react-native安卓环境搭建 


你可能感兴趣的:(react-native)