Skip to content

[add2app] [flutter_plugin_android_lifecycle] Gradle Kotlin Script Error: Unresolved Reference compileSdkVersion #188339

Closed as duplicate

Description

@emakar

Steps to reproduce

this is the same issue as described in #184133 (comment) (can't reopen it)

  1. use add-to-app with flutter 3.44.2
  2. depend on flutter_plugin_android_lifecycle 2.0.35 (or any plugin with build.gradle.kts)
  3. try to build

Expected results

build is successful

Actual results

build fails

e: file:///~/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.35/android/build.gradle.kts:28:26: Unresolved reference 'compileSdkVersion'.

Code sample

see #184133 (comment)

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

[✓] Flutter (Channel stable, 3.44.2, on macOS 26.3.1 25D771280a darwin-arm64, locale en) [758ms]
• Flutter version 3.44.2 on channel stable at /Users/yauhen/fvm/versions/3.44.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c9a6c48 (12 days ago), 2026-06-10 15:52:41 -0700
• Engine revision 77e2e94
• Dart version 3.12.2
• DevTools version 2.57.0
• Pub download mirror https://pub.dev
• Feature flags: enable-web, no-enable-linux-desktop, no-enable-macos-desktop, no-enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, no-enable-swift-package-manager, omit-legacy-version-file,
enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [2.5s]
• Android SDK at /Users/yauhen/Library/Android/sdk/
• Emulator version 36.4.9.0 (build_id 14788078) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• ANDROID_HOME = /Users/yauhen/Library/Android/sdk/
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.10+-117844308-b1163.108)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,955ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17C52
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [7.8s]
• Android SDK built for arm64 (mobile) • emulator-5554 • android-arm64 • Android 15 (API 35) (emulator)
• iPhone 16e (mobile) • FB0CA729-3561-4843-B1BF-ECA5B123EF20 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-3 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 149.0.7827.116

[✓] Network resources [532ms]
• All expected network resources are available.

• No issues found!

Activity

  1. emakar commented on Jun 22, 2026

    @emakar
    ContributorAuthor

    the workaround is to add

    plugins {
        id("dev.flutter.flutter-gradle-plugin") version "1.0.0" apply false
    }
    

    into android/build.gradle.kts (or its groovy variant with corresponding syntax)

  2. suryaKommana2662 commented on Jun 23, 2026

    @suryaKommana2662
    Contributor

    @emakar Thanks for providing the additional context and for referencing #184133.

    The #184133. issue was closed due to insufficient reproduction information, but this report describes a specific add-to-app scenario using include_flutter.groovy, along with affected plugin versions and a workaround.
    keeping this issue open and routing to the team-android for further investigation.

  3. added
    platform-androidAndroid applications specifically
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jun 23, 2026
  4. github-actions commented on Jul 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-androidAndroid applications specificallyteam-androidOwned by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions