Skip to content

[all_packages] Bump compileSdk version to 35 #9168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Apr 28, 2025

Bumps all_packages app to build with compileSdk version 35. Then,

  • Updates the Gradle and AGP versions to support this new Android SDK version
  • Refactors the legacy all_packages CI build target such that the regular all_packages CI build targets (master, stable) will build both the modern all_packages app and the legacy version with the same JDK 17 version, since the legacy version now also requires it (example successful builds: master, stable)
  • Updates legacy all_packages app README.md to more accurately describe how the app was transformed since its creation

Prompted by #8414.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@camsim99
Copy link
Contributor Author

Getting the failure:

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /b/s/w/ir/cache/java
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.
...

┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────┐
│ [!] Android Gradle plugin requires Java 17 to run. You are currently using Java 11. │
│                                                                                     │
│ To fix this issue, try updating to the latest Android SDK and Android Studio on:    │
│ https://developer.android.com/studio/install                                        │
│ If that does not work, you can set the Java version used by Flutter by              │
│ running `flutter config --jdk-dir=“</path/to/jdk>“`                                 │
│                                                                                     │
│ To check the Java version used by Flutter, run `flutter doctor --verbose`           │
└─────────────────────────────────────────────────────────────────────────────────────┘

I assume the build is using Java 11 because all of the plugins have sourceCompatibility, targetCompatibility as Java 11. @stuartmorgan-g is that correct?

@stuartmorgan-g
Copy link
Contributor

build_all_packages_legacy is run on a machine that installs Java 11 because we needed it still; see here and here. You'd need to bump that in the PR.

@camsim99 camsim99 requested review from stuartmorgan-g and a team May 12, 2025 20:57
@camsim99
Copy link
Contributor Author

@reidbaker following up from sync, sounds like I should revert the changes to the legacy target to ensure we are still testing Java 11 as we (Flutter) still support it!

@reidbaker
Copy link
Contributor

Let me review the pr as is, my gut is that legacy package tests using java11 are still valuable but a pr is better than a verbal description.

No work for you right now

@stuartmorgan-g
Copy link
Contributor

Based on https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8714424714677414961/+/u/Run_package_tests/build_all_packages_for_Android_debug/stdout, if we don't make this change I'll need to exempt google_sign_in from the build-all build for now.

@camsim99 camsim99 added the triage-android Should be looked at in Android triage label May 27, 2025
@camsim99
Copy link
Contributor Author

Getting an odd formatting error; taking a look:

Formatting .kt files...
Running command: "java -jar /b/s/w/ir/x/w/packages/script/tool/bin/ktfmt-0.46-jar-with-dependencies.jar ../third_party/packages/flutter_svg/example/android/app/src/main/kotlin/io/flutter/plugins/fluttersvgexample/MainActivity.kt animations/example/android/app/src/main/kotlin/dev/flutter/packages/animations/example/MainActivity.kt camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXLibrary.g.kt [...redacted...]
Error: Invalid or corrupt jarfile /b/s/w/ir/x/w/packages/script/tool/bin/ktfmt-0.46-jar-with-dependencies.jar
Failed to format Kotlin files: exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-android Should be looked at in Android triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants