localizely / intl_utils

Dart package that creates a binding between your translations from .arb files and your Flutter app
BSD 3-Clause "New" or "Revised" License
128 stars 77 forks source link

Incompatible with Flutter 3.16.0 #120

Open navaronbracke opened 7 months ago

navaronbracke commented 7 months ago

There were breaking changes in Dart for file system events.

But the watcher dependency of intl_utils has not been updated (it actually is not even a direct dependency).

Adding a specific dependency on watcher: ^1.1.0 fixed the executable script, though.

My dev dependencies look like:

dev_dependencies:
  flutter_test:
    sdk: flutter

  intl_utils: ^2.8.5
  watcher: ^1.1.0

Logs:

dart run intl_utils:generate
Building package executable... (6.2s)
Failed to build intl_utils:generate:
../../../.pub-cache/hosted/pub.dev/watcher-1.0.2/lib/src/constructable_file_system_event.dart:7:57: Error: The class 'FileSystemEvent' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
abstract class _ConstructableFileSystemEvent implements FileSystemEvent {
                                                        ^
Failed to build intl_utils:generate:
../../../.pub-cache/hosted/pub.dev/watcher-1.0.2/lib/src/constructable_file_system_event.dart:7:57: Error: The class 'FileSystemEvent' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
abstract class _ConstructableFileSystemEvent implements FileSystemEvent {
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.0 23A344 darwin-x64, locale en-BE)
    • Flutter version 3.16.0 on channel stable at /Users/navaronbracke/Documents/flutter
    • Upstream repository git@github.com:navaronbracke/flutter.git
    • FLUTTER_GIT_URL = git@github.com:navaronbracke/flutter.git
    • Framework revision db7ef5bf9f (8 days ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/navaronbracke/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.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.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (2 available)            
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

• No issues found!
lzoran commented 7 months ago

Hi @navaronbracke,

Thank you for bringing this issue to our attention.

I've noted that this error tends to occur when running the intl_utils package after the Flutter upgrade. This might be linked to issues with the Flutter cache following the upgrade, though I still need to investigate further to understand the exact cause.

As a temporary workaround, reinstalling intl_utils often resolves the issue. Could you try this and let us know if it works for you?

Similar issues: FileSystemEvent error, Watcher fails with class FileSystemEvent.

navaronbracke commented 7 months ago

I do not have intl_utils globally activated, only under dev dependencies, since I can run it with dart run intl_utils:generate anyway after fetching dependencies. I did wipe my deps with flutter clean but that didn't fix it iirc.

I do have the latest version of intl_utils, version 2.8.5. For now I have a workaround (explicit dependency on watcher) and it is working.

lzoran commented 7 months ago

Interesting.

I've attempted to replicate the reported issue using the example project, ensuring that the same versions of Flutter and intl_utils are utilized. However, in my testing environment, everything seems to be functioning correctly.

image

davidmartos96 commented 7 months ago

@navaronbracke As far as I know this is because of an inconsistency between watcher v1.0.0 and v1.1.0 with latest Dart. If you do flutter pub upgrade or dart pub upgrade, your transitive dependencies will get updated and you wouldn't need to explicitly depend on version 1.1.0.