Android build with newer AGP requiring gradle 9.1.0+ fails with early Settings_gradle error

21 hours ago 1
ARTICLE AD BOX

The newer AGP's require gradle 9.1. When I upgrade gradle from 9.0.1 to 9.1 or newer I get this error on my win-system, using java21:

FAILURE: Build failed with an exception. * What went wrong: 'void Settings_gradle.<init>(org.gradle.kotlin.dsl.support.KotlinScriptHost, org.gradle.plugin.use.PluginDependenciesSpec, org.gradle.api.initialization.Settings)'

I have tried both my own project and also others like this this jetsnack project using gradle 9.1.0, and this works on my system: https://github.com/android/compose-samples
Though if I in jetsnack try to upgrade to gradle 9.2.0 I have to delete a url line in the settings.gradle and then it fails in the same way.

Here's output from : ./gradlew -version

------------------------------------------------------------ Gradle 9.3.1 ------------------------------------------------------------ Build time: 2026-01-29 14:15:01 UTC Revision: 44f4e8d3122ee6e7cbf5a248d7e20b4ca666bda3 Kotlin: 2.2.21 Groovy: 4.0.29 Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024 Launcher JVM: 21.0.10 (Eclipse Adoptium 21.0.10+7-LTS) Daemon JVM: C:\ProgramData\scoop\apps\temurin21-jdk\current (no Daemon JVM specified, using current Java home) OS: Windows 11 10.0 amd64

This is my gradle.properties, though deleting it cause same failure, so probably irrelevant for this:

android.experimental.enableTestFixturesKotlinSupport=true android.useAndroidX=true android.enableJetifier=false org.gradle.caching=true org.gradle.caching.debug=false org.gradle.configuration-cache=true org.gradle.configureondemand=true org.gradle.daemon.idletimeout=10800000 org.gradle.console=auto kapt.include.compile.classpath=true org.gradle.parallel=true org.gradle.jvmargs=-Xmx20g -XX:+UseParallelGC -Dfile.encoding=UTF-8

Is this some kind of new type of error that there's a way to debug? gradlew --scan does not work, this error happens very early in gradle setup.

Read Entire Article