Open k0psutin opened 2 months ago
I have the same issue with XML and Glance Widgets but when I add the work-runtime to build.gradle, I get the following tested with XML widgets:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
Not sure if this has something to do with the migration of build.gradle to the latest non imperative version. I could not make any widget work because of these errors.
Bumping this since facing the same issue. What should be the correct fix for this?
I faced with same issue
What happened?
I noticed that if I use
home_widget: ^0.7.0
withworkmanager: ^0.5.2
it will give a duplicate class exception during build, removinghome_widget: ^0.7.0
resolves this issue.My dependencies:
It seems that at the
home_widget
example, there is aimplementation "androidx.work:work-runtime-ktx:2.8.1"
inbuild.gradle
.After I added the same implementation, the build finally passed. I think the README should be updated to inform that the user should implement the same work-runtime-ktx as in the example? Or is it possible to fix home_widget so that the user don't have to determine the version?
How to reproduce:
Remove
implementation "androidx.work:work-runtime-ktx:2.8.1"
from examplebuild.gradle
What do you expect?
Build to complete
Relevant log output
Execute in a terminal and put output into the code block below
[✓] Flutter (Channel stable, 3.24.3, on macOS 13.6.7 22G720 darwin-arm64, locale en-FI) • Flutter version 3.24.3 on channel stable at /Users/xxxx/fvm/versions/3.24.3 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (2 weeks ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/xxxx/Library/Android/sdk • Platform android-34-ext11, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.15.2
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
[✓] VS Code (version 1.93.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.96.0
[✓] Connected device (4 available) • 2109119DG (mobile) • 40a26781 • android-arm64 • Android 14 (API 34) • macOS (desktop) • macos • darwin-arm64 • macOS 13.6.7 22G720 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 13.6.7 22G720 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.70
[✓] Network resources • All expected network resources are available.
• No issues found!
On which Platform do you experience this issue?
Android
Other information
Add
implementation "androidx.work:work-runtime-ktx:2.8.1"
tobuild.gradle
dependencies and it will build again. I hope it doesn't have any side-effects for other packages.Are you interested in working on a PR for this?