当前位置:   article > 正文

react-native android编译报错_react-native编译报错 failure: build failed with an exc

react-native编译报错 failure: build failed with an exception. * what went wr

报错信息

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.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 10.485 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

里面有这一句,是SDK的原因

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

所以在android 文件目录新建 local.properties 文件,加入自己的SDK文件目录

sdk.dir =C:\\Users\\Ledev2\\AppData\\Local\\Android\\Sdk
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/390212
推荐阅读
相关标签
  

闽ICP备14008679号