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

Android Gradle Plugin 7.3 incompatible with device_calendar due to a transitive dependency flutter_native_timezone #483

Closed
agacemi opened this issue Apr 24, 2023 · 21 comments
Labels
bug Something isn't working

Comments

@agacemi
Copy link

agacemi commented Apr 24, 2023

Describe the bug

When upgrading to AGP 7.3.x in order to use kotlin 1.8.x, build failed because of flutter_native_timezone used by device_calendar. flutter_native_timezone seems not be maintained et uses a very old version of kotlin

To Reproduce

  • Upgrade to AGP 7.3.1
  • Build app
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 17s

Expected behavior

  • Build successful

Flutter doctor
Run a flutter doctor so we can rule out env issues

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E261 darwin-arm64, locale
    fr-FR)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.3)
[✓] IntelliJ IDEA Community Edition (version 2022.2.3)
[✓] VS Code (version 1.77.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category
@agacemi agacemi added the bug Something isn't working label Apr 24, 2023
@saropa
Copy link

saropa commented Apr 24, 2023

Same issue here.

The readme (https://github.com/builttoroam/device_calendar/tree/master#readme) refers to replacement of the apparently stale/deprecated package [flutter_native_timezone] (ref: pinkfish/flutter_native_timezone#53).

There are many issue / PR references to "version 5" (going back ~6 months) which has not been released. The current version at time of writing being 4.3.1.

Discussion of this issue appears to be here #474

@agacemi
Copy link
Author

agacemi commented Apr 28, 2023

I think I found that it's not going well. The package 4.3.1 in pub dev (https://pub.dev/packages/device_calendar) was pushed from master branch, not from 4.3.1 tag.

For this reason, the two fellowing configuration don't give the same thing:

  device_calendar:
    git:
      url: https://github.com/builttoroam/device_calendar.git
      ref: 4.3.1
  device_calendar: ^4.3..1

Please push the right version of plugin on pub dev

@VeryGiack
Copy link

Any news on this?

@agacemi
Copy link
Author

agacemi commented Jun 8, 2023

@VeryGiack a workaround is to use in your pubspec.yaml

  device_calendar:
    git:
      url: https://github.com/builttoroam/device_calendar.git
      ref: 4.3.1

instead of

  device_calendar: ^4.3.1

cf . reason in my last comment #483 (comment)

@VeryGiack
Copy link

Hi @agacemi using:

device_calendar:
    git:
      url: https://github.com/builttoroam/device_calendar.git
      ref: 4.3.1

give me this error:

e: /Users/giack/.pub-cache/git/device_calendar-c7300b0e729889311243cea51adfdf04761157ef/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt: (612, 42): Unresolved reference: toDuration
e: /Users/giack/.pub-cache/git/device_calendar-c7300b0e729889311243cea51adfdf04761157ef/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt: (612, 53): This declaration is experimental and its usage must be marked with '@kotlin.time.ExperimentalTime' or '@OptIn(kotlin.time.ExperimentalTime::class)'
e: /Users/giack/.pub-cache/git/device_calendar-c7300b0e729889311243cea51adfdf04761157ef/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt: (612, 66): This declaration is experimental and its usage must be marked with '@kotlin.time.ExperimentalTime' or '@OptIn(kotlin.time.ExperimentalTime::class)'

@agacemi
Copy link
Author

agacemi commented Jun 8, 2023

Which version of kotlin you use ? This must be at least kotlin 1.6

@VeryGiack
Copy link

Ohh thanks i was using 1.5.30, i'll try with 1.6

@VeryGiack
Copy link

I've updated to kotlin 1.8.21 (current latest) and now it works, thx @agacemi

@bardram
Copy link

bardram commented Jul 24, 2023

Hi @thomassth or others... Any update on this? It would be good with a release (4.3.2 ?) that uses the flutter_timezone plugin instead of the deprecated flutter_native_timezone plugin.

The current version (4.3.1) is causing a lot of problems.... And we can't use the GitHub branch linked above, since we are using this device_calendar in another published Flutter package to be released at pub.dev. And you can't publish plugins that rely on non-published packages....

@thomassth
Copy link
Contributor

If someone makes a PR I'll approve it

Otherwise I don't have an estimate, and neither do any of the other maintainers it seems

tbf most of us only became "maintainers" to push some PRs we had at the time, and if you wanna help maintain this package, check out the discussion topic and leave a note there

@agacemi
Copy link
Author

agacemi commented Jul 24, 2023

@bardram @thomassth I would just to note that there is a workound by using gît tag 4.31 instead of using pub dev version 4.31.

Cf. my comment above, i explain why.
Regards

@techwn
Copy link

techwn commented Jul 31, 2023

@bardram @thomassth I would just to note that there is a workound by using gît tag 4.31 instead of using pub dev version 4.31.

Cf. my comment above, i explain why. Regards

It works. but I think we need a patch fix version like 4.3.2 in pub.dev.

@thomassth
Copy link
Contributor

I need someone other than me to create a PR so I can approve and merge. Can do both on my own.

@thomassth thomassth mentioned this issue Sep 16, 2023
@bardram
Copy link

bardram commented Sep 18, 2023

Seems like this has been fixed and merged now - now someone with publish access to pub.dev should publish a new version.

Thanks.

@azmasamy
Copy link

Would any maintainer please publish the new version?

@thomassth
Copy link
Contributor

It has to be @nickrandolph
While we may have a few (busy) maintainers, only nick can get the (updated) API key needed for publishing.

@nickrandolph
Copy link
Contributor

@thomassth I tried emailing you re ownership of the repo. Get back to me, or DM on twitter, so we can unblock this

@azmasamy
Copy link

azmasamy commented Oct 8, 2023

Could any of the maintainers fork the repo and create another package that is properly updated?

Also there is an update in the IOS calendar API for IOS17. I can't ask for calendar permission using the package but I don't know if it effects any other feature.

@thomassth
Copy link
Contributor

For now, you can ask for iOS 17 specific permissions with flutter plugins that handles device permissions.

I've DM'd nick, so we might have some news after the weekend.

@bardram
Copy link

bardram commented Nov 25, 2023

It seems like this issue has been fixed with release 4.3.2 - am I right?

If so, this issue can be closed.

@agacemi
Copy link
Author

agacemi commented Nov 26, 2023

Thank you I conform it fix the issue and thus can be closed.

@agacemi agacemi closed this as completed Nov 26, 2023
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

8 participants