本文介绍了React Native Android构建失败.找不到SDK位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我开始运行android时出现错误

I have error when i start running android

What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

推荐答案

  • 转到您的本机项目的android/目录
  • 使用以下行创建一个名为local.properties的文件:
    • Go to the android/ directory of your react-native project
    • Create a file called local.properties with this line:
    • sdk.dir = /Users/USERNAME/Library/Android/sdk
      

      USERNAME是您的macOS用户名

      Where USERNAME is your macOS username

      这篇关于React Native Android构建失败.找不到SDK位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 01:30