builttoroam / device_calendar

A cross platform plugin for modifying calendars on the user's device
https://pub.dev/packages/device_calendar
BSD 3-Clause "New" or "Revised" License
267 stars 267 forks source link

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

Closed agacemi closed 10 months ago

agacemi commented 1 year ago

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

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

saropa commented 1 year ago

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: https://github.com/pinkfish/flutter_native_timezone/issues/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 https://github.com/builttoroam/device_calendar/issues/474

agacemi commented 1 year ago

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 commented 1 year ago

Any news on this?

agacemi commented 1 year ago

@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 https://github.com/builttoroam/device_calendar/issues/483#issuecomment-1527022138

VeryGiack commented 1 year ago

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 commented 1 year ago

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

VeryGiack commented 1 year ago

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

VeryGiack commented 1 year ago

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

bardram commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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

bardram commented 1 year ago

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

Thanks.

azmasamy commented 1 year ago

Would any maintainer please publish the new version?

thomassth commented 1 year ago

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 commented 12 months ago

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

azmasamy commented 12 months ago

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 commented 12 months ago

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 commented 10 months ago

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

If so, this issue can be closed.

agacemi commented 10 months ago

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