FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':app'.

> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

今天刚学react-native,搭建环境过程中遇到以上报错信息,搜集网上方法,最后解决了。

解决方法:

在新建的安卓项目目录中的andriod目录中新建一个文件:local.properties,然后加上sdk.dir = D:\\AndriodSdk(我的安卓SDK安装在D:\AndriodSdk目录)

运行react-native run-andriod,成功了

你可能感兴趣的:(前端)