I am trying to get the LocalTimeZone in my Flutter app. For this purpose, I used 'package:timezone/timezone.dart' with a conjunction of 'package:flutter_native_timezone/flutter_native_timezone.dart';. But when I install the flutter_native_timezone v.2.0.0. I got an error in Android build like this:
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':flutter_native_timezone' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
My Kotlin plugin version is 1.8.10. I tried to downgrade it to 1.5.20, but same result. I tried with the lower version of the library but the error still persists.
flutter doctor output looks like this:
[✓] Flutter (Channel stable, 3.7.12, on macOS 12.0.1 21A559 darwin-arm64, locale en-BG)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.79.2)
[✓] VS Code (version 1.64.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability