fluttercommunity / wakelock_plus

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, Linux, and web.
BSD 3-Clause "New" or "Revised" License
71 stars 54 forks source link

Build error while dexing in version 1.1.2 #12

Closed under3415 closed 1 year ago

under3415 commented 1 year ago

Getting build error since upgrading wakelock_plus from 1.1.1 to 1.1.2 Seems related to Kotlin change in package_info_plus 5.0.0

My project is using Gradle 7.4.2 with Kotlin 1.8.22 Error and doctor below...

Error

> Execution failed for DexingNoClasspathTransform: C:\Users\user\gradle\caches\transforms-3\895f5e82da7dbcc7f0c0d8b022ac8b49\transformed\jetified-kotlin-stdlib-1.9.10.jar.
> Error while dexing.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 48s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
│ To disable the shrinker, pass the `--no-shrink` flag to this command.      │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Flutter Doctor

[√] Flutter (Channel stable, 3.13.6, on Microsoft Windows [Version 10.0.22621.2361], locale en-NZ)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2022.3)
[√] VS Code (version 1.83.0)
diegotori commented 1 year ago

https://github.com/fluttercommunity/plus_plugins/issues/2018#issuecomment-1696285675

I remember I had to do this earlier this year in order to force all Android Gradle dependencies to use a particular Kotlin version.

under3415 commented 1 year ago

I've downgraded to 1.1.1 for now:

wakelock_plus: 1.1.1

under3415 commented 1 year ago

Updating firebase-bom to the latest version in android/app/build.gradle seems to have resolved the issue:

dependencies {
    implementation platform('com.google.firebase:firebase-bom:32.3.1') //https://firebase.google.com/support/release-notes/android
}