0

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'

Expo Build Details

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!!!!

1
  • The env variable ANDROID_SDK_ROOT is not the same as ANDROID_HOME. If expo want's this variable create it and let it point to your Android SDK folder. And I would remove the wrong ANDROID_SDK_ROOT from eas.json, those values seem to orifinakte from a Linux system. Commented Jun 1 at 10:11

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.