[stderr] > Could not resolve all task dependencies for configuration ':classpath'. [stderr] > Could not find com.android.tools.build:gradle:7.6.1.

When running eas build, I get this inexplicable error
(I tried changing gradle versions, I still get the same error no matter the version)
Any help is greatly appreciated.

Full error:
[stderr]

⚠️  Cannot resolve the path to "eas-cli" package.

22[stderr]

FAILURE:

23[stderr]

Build failed with an exception.

24[stderr]

* What went wrong:

25[stderr]

A problem occurred configuring root project 'lbnapp_new'.

26[stderr]

> Could not determine the dependencies of null.

27[stderr]

   > Could not resolve all task dependencies for configuration ':classpath'.

28[stderr]

> Could not find com.android.tools.build:gradle:7.6.1.

29[stderr]

        Searched in the following locations:

30[stderr]

          - http://10.4.1.4:8081/artifactory/libs-release/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

31[stderr]

          - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

32[stderr]

          - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

33[stderr]

        Required by:

34[stderr]

            project :

35[stderr]

> Could not find com.android.tools.build:gradle:7.6.1.

36[stderr]

        Searched in the following locations:

37[stderr]

          - http://10.4.1.4:8081/artifactory/libs-release/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

38[stderr]

          - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

39[stderr]

          - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.6.1/gradle-7.6.1.pom

40[stderr]

        Required by:

41[stderr]

            project : > project :react-native-gradle-plugin

42[stderr]

* Try:

Hey @arnav_123, can you share the link to your EAS Build that is failing so I can look into it if its failing on any other step? (Note: the EAS Build link shared in forums is only accessible to Expo team members).

Sorry for the late reply, after 5 hours i just deleted my android folder and the problem magically fixed itself, no idea what happened. Thanks for the response

Hi @arnav_123

It seems you ran either npx expo run:android or npx expo prebuild at some point. That generates the native Android and iOS projects, which effectively switches you to the bare workflow. Deleting the android and ios directories switches you back to the managed workflow.

As long as you did not intentionally create the android directory and did not intentionally make changes to the code in the android directory, then you can just delete it.