I'm facing a persistent error when trying to build my Expo React Native app using EAS Build. The build fails with an SDK resolution error related to the ANDROID_SDK_ROOT and sdk.dir properties.
Build Error Output:
WARNING: The following problems were found when resolving the SDK location:
Where: ANDROID_SDK_ROOT environment variable. Problem: Directory does not exist
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalReportRelease'.
> Could not resolve all dependencies for configuration ':app:releaseCompileClasspath'
Configuration Details
eas.json
{
"cli": {
"version": ">= 16.6.2",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"env": {
"ANDROID_SDK_ROOT": "/opt/android-sdk"
}
},
"preview": {
"distribution": "internal",
"env": {
"ANDROID_SDK_ROOT": "/opt/android-sdk"
}
},
"production": {
"autoIncrement": true,
"env": {
"ANDROID_SDK_ROOT": "/opt/android-sdk"
}
}
},
"submit": {
"production": {}
}
}
android/local.properties:
sdk.dir=C\:\\Users\\Vishwanth Prakash\\AppData\\Local\\Android\\Sdk
I also added the same SDK path to my environment variables (ANDROID_HOME) on my local machine. Here's a screenshot:
Environment Variable screenshot
Help me to solve this!!!!
ANDROID_SDK_ROOTis not the same asANDROID_HOME. If expo want's this variable create it and let it point to your Android SDK folder. And I would remove the wrongANDROID_SDK_ROOTfromeas.json, those values seem to orifinakte from a Linux system.