1. 程式人生 > 實用技巧 >yarn android報錯 未找到sdk (SDK location not found. Define location with an ANDROID_SDK_ROOT)

yarn android報錯 未找到sdk (SDK location not found. Define location with an ANDROID_SDK_ROOT)

報錯內容:

  • What went wrong:
  • Could not determine the dependencies of task ‘:app:installDebug’. > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project’s local properties file at ‘C:\Users\12779\learning\react_native_app\AwesomeProject\android\local.properties’.

解決方法:
ANDROID_HOME 環境變數名改成 ANDROID_SDK_ROOT即可
在這裡插入圖片描述
在這裡插入圖片描述