Skip to content
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

🐞Cannot build app using this package #586

Open
4 tasks done
Mihai-B opened this issue Jan 18, 2025 · 3 comments
Open
4 tasks done

🐞Cannot build app using this package #586

Mihai-B opened this issue Jan 18, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Mihai-B
Copy link

Mihai-B commented Jan 18, 2025

  • 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

0.5.2

Technology Version
Workmanager version 0.5.2

Describe the error
If I add this package to my pubspec.yml, I get this error:

Running Gradle task 'assembleDebug'...
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt:14:44 Unresolved reference 'shim'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt:98:55 Unresolved reference 'registerWith'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/BackgroundWorker.kt:98:68 Unresolved reference 'ShimPluginRegistry'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:35:52 Unresolved reference 'PluginRegistrantCallback'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:38:52 Unresolved reference 'Registrar'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:40:49 Unresolved reference 'context'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:40:70 Unresolved reference 'messenger'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:41:23 Unresolved reference 'addViewDestroyListener'.
e: file:///home/mike/.pub-cache/hosted/pub.dev/workmanager-0.5.2/android/src/main/kotlin/dev/fluttercommunity/workmanager/WorkmanagerPlugin.kt:49:80 Unresolved reference 'PluginRegistrantCallback'.

Output of flutter doctor -v

[✓] Flutter (Channel beta, 3.28.0-0.1.pre, on Arch Linux 6.12.9-arch1-1, locale en_US.UTF-8)
    • Flutter version 3.28.0-0.1.pre on channel beta at -/SDKs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3e493a3e4d (5 weeks ago), 2024-12-12 05:59:24 +0900
    • Engine revision 2ba456fd7f
    • Dart version 3.7.0 (build 3.7.0-209.1.beta)
    • DevTools version 2.41.0

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at -/android
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = -
    • Java binary at: -/android-studio/jbr/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.4+-12422083-b607.1)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = -/bin/google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 19.1.6
    • cmake version 3.31.4
    • ninja version 1.12.1
    • pkg-config version 2.3.0

[✓] Android Studio (version 2024.2)
    • Android Studio at -/android-studio
    • Flutter plugin version 83.0.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Linux (desktop)              • linux         • linux-x64      • Arch Linux 6.12.9-arch1-1
    • Chrome (web)                 • chrome        • web-javascript • Chromium 131.0.6778.264

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

• No issues found!

@Mihai-B Mihai-B added the bug Something isn't working label Jan 18, 2025
@R0ya1Eag1e
Copy link

have same error

@R0ya1Eag1e
Copy link

temporarily fixed this, opened BackgroundWorker.kt and WorkmanagerPlugin.kt in \AppData\Local\Pub\Cache\hosted\pub.dev\workmanager-0.5.2\android\src\main\kotlin\dev\fluttercommunity\workmanager and commented this lines:
in BackgroundWorker.kt: 14 and 98
in WorkmanagerPlugin.kt: from 34 to 52

it seems like android embedding method v1 is no longer supported by flutter and this lines can be deleted

@Mihai-B
Copy link
Author

Mihai-B commented Jan 19, 2025

This might be a duplicate of: #564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants