flutter_tools/gradle: dependency_version_checker.gradle.kts references non-existent com.android.Version class`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- android, kotlin
- Domain
- build-system
Research direction
Start in packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts at line 160, where the Android version class names are referenced. Replace the compile-time class references with the string names used by the reflective loading, then run flutter build apk --debug or assembleDebug to verify that the flutter_tools/gradle module compiles and Android configuration succeeds.
Written by the indexing model from the issue text.
Description
Steps to reproduce
Steps to reproduce
flutter build apk --debug(orassembleDebugdirectly) any Android
project on Flutter 3.44.1 (stable), building from a local Flutter SDK
checkout on Windows.
Expected results
Gradle configuration succeeds.
Actual results
The flutter_tools/gradle module itself fails to compile with
Unresolved reference: Version, before the project's own Gradle files are
even evaluated.
Root cause
packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:160
references com.android.Version::class.java.name (and a fallback
com.android.builder.model.Version::class.java.name) at compile time.
Neither class exists in any real Android Gradle Plugin release — I checked
every AGP jar from 7.3.0 through 8.13.1 byte-for-byte (unzip -l) and none
of them ship a com.android.Version or com.android.builder.model.Version
class. The actual intended usage is via reflection
(classLoader.loadClass(...)), so the class doesn't need to be resolvable
at compile time at all — referencing it via ::class forces the Kotlin
compiler to require it on the compile classpath, which fails.
Fix
Replace the ::class.java.name references with plain string literals
("com.android.Version" / "com.android.builder.model.Version"), since
the class is only ever loaded reflectively:
```kotlin
// before
com.android.Version::class.java.name
// after
"com.android.Version"
Expected results
Confirmed independent of Gradle version (reproduces on 8.14.4, 9.1.0, 9.3.1) and JDK (18, 24). Verified the fix unblocks compilation of the flutter_tools/gradle module. Happy to open a PR.
Actual results
C:\DSW\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, 3.44.1, on Microsoft Windows [versÆo 10.0.26200.9457], locale pt-BR) [321ms]
• Flutter version 3.44.1 on channel stable at C:\DSW\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 924134a44c (4 months ago), 2026-05-29 12:13:22 -0400
• Engine revision c416acfeb8
• Dart version 3.12.1
• DevTools version 2.57.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[√] Windows Version (Windows 11 or higher, 25H2, 2009) [1.588ms]
[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [927ms]
• Android SDK at C:/Users/luis/AppData/Local/Android/Sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-CinnamonBun, build-tools 36.0.0
• ANDROID_HOME = C:/Users/luis/AppData/Local/Android/Sdk
• Java binary at: C:\Program Files\Java\jdk-24\bin\java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: flutter config --jdk-dir="path/to/jdk".
• Java version Java(TM) SE Runtime Environment (build 24+36-3646)
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web [89ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.19) [88ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.14.36623.8
• Windows 10 SDK version 10.0.26100.0
[√] Connected device (3 available) [237ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [versÆo 10.0.26200.9457]
• Chrome (web) • chrome • web-javascript • Google Chrome 153.0.8010.50
• Edge (web) • edge • web-javascript • Microsoft Edge 153.0.4234.32
[√] Network resources [361ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
Process finished with exit code 0
Code sample
Code sample
[Paste your code here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[Paste your output here]
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 33.2k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 407
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flutter/flutter
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
P2 platform-ios platform-macos team-ios tool triaged-ios
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[pigeon] Stop binding HostApi interfaces with jnigen: they're unused and make up 35% of the `.jni.dart` filePossibly taken @tarrinneal claimed this 2 days ago. Openp: pigeon P2 package team-ecosystem triaged-ecosystem
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
flutter/flutter#193882 · 1 assignee ·
Maintainers usually reply within 1 day
-
[pigeon] Swift FFI (`swift_use_ffi`) generates code that doesn't compile for files with event channels or ProxyApisPossibly taken @tarrinneal claimed this 2 days ago. Openp: pigeon P2 package team-ecosystem triaged-ecosystem
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
flutter/flutter#193881 · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
intel/rohd-wave-viewer#11 ·
-
DOCS UPDATE: README.md and BACKEND.md reference a search-meetings edge function that does not existOpendocumentation
Difficulty 1/5 1-3 hours Newbie friendliness 93/100
AOSSIE-Org/Ell-ena#337 ·
-
cat: puzzle
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
lichess-org/mobile#3826 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
saber-notes/saber#1844 ·
-
area-clientside-dartpad
Difficulty 1/5 Under an hour Newbie friendliness 64/100
Maintainers usually reply within 2 days