Reputation: 1
I've been having this same problem with building my android game from Unity. I recently changed from version 2021.3.7f1 to 2022.3.29f1 and then back again trying to fix a separate issue with my APK permissions. But since changing back between the two, I have been unable to run a build and instead have the error message.
So far I have gone to the gradle.properties file and deleted the r8 entry line, manually changed the gradle reference from 7.1.2 to 6.1.1 in the build.gradle file but neither seem to have done anything and I'm getting the same error message.
Here's the error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':launcher'.
> Could not resolve all artifacts for configuration ':launcher:classpath'.
> Could not find com.android.tools.build:gradle:6.1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
Required by:
project :launcher
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Any help would be appreciated, happy to clarify points
Upvotes: 0
Views: 389
Reputation: 27414
You need to distinguish between Gradle and Android Gradle plugin (aka AGP) clearly. The former is a build system, the later is a plugin of the former. "com.android.tools.build:gradle" is the package name of AGP. Gradle has a version 6.1.1, but AGP does not. All version numbers of AGP can be found here: https://developer.android.com/build/releases/gradle-plugin#updating-gradle If you've downgraded gradle to 6.1.1, the minimal version of AGP is 4.0.0 (note: Unity >= 2021 requires at least 4.0.1 https://docs.unity3d.com/Manual/android-gradle-overview.html)
Upvotes: 0