I got a message from the Google Play store telling...
# community-support
m
I got a message from the Google Play store telling me I needed to update my target API to 35. This seemed like a simple request. I tried updating all instances of 34 to 35, which did not work. I tried researching the issue, which lead to updating my APG, which lead to upgrading Android Studio to 2025.1.1 After updating AS my app's gradle version is too outdated for AS to run. I tried using APG to update to 9.0-milestone-1 and got the following error Could someone help me fix this?
p
Never share a screenshot. And the important message is visible when clicking on cabd-android failed (IntelliJ tries to be „smart“ and does not show all errors…)
But do you really need a 9.0.0 version? If so, you should use the rc-1 version instead of an outdated milestone.
m
I don't know that I need a 9.0.0 version, when I'm on the old 7.5.1 version the solutions listed were upgrading to 9.0-milestone-1 or 8.5. I figured I'd go to the highest version available. I did try 8.5 after and it had its own issues
Copy code
Your build is currently configured to use incompatible Java 21.0.6 and Gradle 7.5.1. Cannot sync the project.

We recommend upgrading to Gradle version 9.0-milestone-1.

The minimum compatible Gradle version is 8.5.

The maximum compatible Gradle JVM version is 18.

Possible solutions:
 - Upgrade to Gradle 9.0-milestone-1 and re-sync
 - Upgrade to Gradle 8.5 and re-sync
v
The shown version are not the latest versions, but the first ones to support Java 21, whyever you upgraded the Java version (you didn't mention that yet). https://docs.gradle.org/current/userguide/compatibility.html Latest versions available are 8.14.2 and 9.0.0-rc-1 with the latter of course only being a release candidate, not a stable release.
m
I haven't updated my Java version AFAIK, I only upgraded Kotlin to 15
v
Well, maybe the AS update got smarter and tells you now. But then you already used something bad in the past, either downgrade your Java or upgrade your Gradle according to compatibility matrix
m
It looks like I'm on JDK: jbr-17
v
No, you are not
image.png
m
Oh. I'll be upfront I don't know what any of these terms mean. There was some window I can't find anymore that said jetbrains was on version 17
v
That might be, but what Java version your IDE is run on has nothing to do with the Java version you use to run Gradle.
And the window you mean was probably "Help -> About"
m
I don't think so, in the window I was in jbr was in a dropdown
I'm on a Mac so the navigation is a bit different
v
Maybe the jbr (JetBrains Runtime) in version 17 was one option that you selected for something else, or just an option you didn't select. 🤷‍♂️ Point is, the error is telling you you use Java 21 to run Gradle and that is not supported for that Gradle version.
m
sun.jvm.hotspot.runtime.VM.saBuildVersion=21.0.6+-13391695-b895.109
I found this line in sa.properties, which I don't think I'm supposed to edit manually. What's the best practise for updating my java version?
Or downgrading, as it seems to suggest I need to lower to JVM 18?
v
I have no idea what
sa.properties
should be. How you control the Java version you run Gradle with depends on how you run Gradle. From commandline it is what you configured in
JAVA_HOME
or if nothing then what is found in
PATH
. For IJ or AS it is what you configured in its Gradle settings. ...
And yes, if you want to use Gradle 7.5 you need to use something between Java 8 and 18
m
I'm more than happy to upgrade Gradle past 7.5, the end goal is to have the app target Android 15 (sdk 35) and everything else has been something I stumbled into on the way
v
Well, then do it 🤷‍♂️ 🙂
m
That sure is what I'm trying to do
I upgraded AS along the way because I read something that said it would be necessary and now it cannot run the app as it was anymore
r
You have many dependencies that depend which each other. Updating some will require you to update others. You should always heck here the compatibility matrix between all of these tools in these two pages: • https://developer.android.com/build/releases/gradle-plugin#compatibilityhttps://docs.gradle.org/current/userguide/compatibility.html In order to target Android 35, you need to be at least in AGP 8.6.0 and Android Studio Koala Feature Drop | 2024.2.1. At the same time AGP 8.6.0 requires minimum Gradle version 8.7. You should be able to use either JDK 17 or 21. You might also need to update your kotlin version to be compatible with the embedded one from gradle. Check the above links for details. If you wanna go to latest stable versions, this currently works on my machine: Gradle 8.14.2, AGP 8.11.0, Narwhal | 2025.1.1, JDK 21, Kotlin 2.1.21.
m
Thanks so much for the info! I've updated the above 5 to the versions you have listed. I tried doing a gradle sync and got the following error:
Copy code
A problem occurred configuring project ':extension-localization'.
> org.codehaus.groovy.runtime.metaclass.MissingMethodExecutionFailed: No signature of method: org.gradle.api.reporting.internal.DefaultSingleFileReport.enabled() is applicable for argument types: (Boolean) values: [true]
I think the issue is with a library used in the project. I think this is used in mapbox (which I'm using).
v
Run with
--stacktrace
or
--scan
and you don't need to guess where the problem is coming from.
The problem is, that either your build script of some plugin you apply is not compatible with the Gradle version you are using now as you try to use
enabled
on a report which in the meantime is
required
.
If you update Gradle, you should for a smooth upgrade experience always: • upgrade to the latest Gradle patch version within the same major version • upgrade all plugins to the latest versions that support that Gradle version • fix all deprecation warnings of Gradle • upgrade to the latest Gradle patch version in the directly following major version • repeat from second step on until you are at your target Gradle version
1
r
I listed only the main dependencies for Android development, of course many of the other dependencies you use in your project will need to be updated also to versions compatible with these.
v
Except for rare edge cases Gradle does not do breaking changes within the same major version or without preceding deprecation
m
I ran with --scan and I get the same error. I don't know how to update the dependency. extension-localization only shows up once in the repo, in settings.gradle.kts
Copy code
include(
  ":app",
  ":extension-style",
  ":extension-style-lint-rules",
  ":extension-localization"
  ...
)
There's no field to include a version number. I don't suppose there's a "update all packages to latest" command?
v
I ran with --scan and I get the same error.
Of course you do, would be tragic if not. Now open the Build Scan URL or share it, then you can look at the full stacktrace.
Besides that, this line in the settings script declares which projects are part of your build
There is no version as those are not dependencies
Those are YOUR projects with YOUR code and build scripts
If you would have followed the procedure I described, you would probably have got a more helpful deprecation warning that you could have fixed more easily.
Now open
extension-localization/build.gradle.kts
and change the illegal
enabled
usage on the report
Then hunt for the next problem you might have fixed more easily
m
problems-report.zip
v
What's that?
That is not a Build Scan URL
m
That is a build report that was generated in the repo
Copy code
[Incubating] Problems report is available at: file:///home/*/build/reports/problems/problems-report.html
v
So? What has that to do with your build script compilation error?
That report is for example showing the deprecations you should fix
Still don't get why you sent that
m
I couldn't see any other report urls
v
If you have run with
--scan
it is one of the last lines, just look
m
Copy code
CONFIGURE FAILED in 2s
This is the last line. The sync is still running 10 minutes later despite not making any progress
v
Ah, hm, it might fail before being able to create the build scan.
Well, then use
--stacktrace
as suggested above to at least get the stacktrace.
Or take a step back and follow the procedure I described which will make your life much easier. 🤷‍♂️