Skip to content

🐞Android plugin not found when using AGP9 #710

Description

@EdwynZN
  • I have read the README
  • I have done the setup for Android
  • I have done the setup for iOS
  • I have ran the sample app and it does not work there

Version

Technology Version
Workmanager version 0.10.1
Xcode version 26.2
Swift version 6.2.3
iOS deployment target 15

Describe the error


Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler output below.
  Error: [        ] /home/runner/work/mobile-app/mobile-app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:164: error: cannot find symbol
  [        ]       flutterEngine.getPlugins().add(new dev.fluttercommunity.workmanager.WorkmanagerPlugin());
  [        ]                                                                          ^
  [        ]   symbol:   class WorkmanagerPlugin
  [        ]   location: package dev.fluttercommunity.workmanager

I believe this has to be with gradle and AGP version as other projects with workmanager runs normally. I tested it in my computer and with CI/CD but fails only in android. I dont have a reproducible project right now but it seems that when upgrading from 0.9.0+3 to 0.10.1 the error appears, I had to downgrade and clear the transitive packages upgraded

plugins {
    id("dev.flutter.flutter-plugin-loader") version "1.0.0"
    id("com.android.application") version "9.2.1" apply false
    // START: FlutterFire Configuration
    id("com.google.gms.google-services") version("4.4.4") apply false
    id("com.google.firebase.firebase-perf") version("2.0.2") apply false
    id("com.google.firebase.crashlytics") version("3.0.7") apply false
    // END: FlutterFire Configuration
    id("org.jetbrains.kotlin.android") version "2.3.10" apply false
}

and in gradle-wrapper.properties:


distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-all.zip

Output of flutter doctor -v

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.44.0, on macOS 26.5.2 25F84 darwin-arm64, locale en-MX)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Connected device (1 available)
    ! Error: Browsing on the local area network for Edwin’s iPhone. Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions