Closed Abolfazlnezami2000 closed 2 weeks ago
I'm unable to reproduce the issue. Can you share more details and steps to reproduce and test it in a new Flutter project? Did this issue happen recently after 10.8.3
?
I tried running a new Flutter project, and everything worked fine, so the issue seems specific to my main project. I also tested with versions 10.8.3 and 10.8.2, but the issue persists in both.
my other packages: cached_network_image: ^3.4.1 carousel_slider: ^5.0.0 collection: ^1.18.0 device_info_plus: ^10.1.2 dio: ^5.7.0 dotted_border: ^2.1.0 equatable: ^2.0.5 file_picker: ^8.1.2
flutter: sdk: flutter
flutter_advanced_drawer: ^1.3.6 flutter_bloc: ^8.1.6 flutter_svg: ^2.0.10+1 flutter_timezone: ^2.1.0 flutter_typeahead: git: url: https://github.com/AbdulRahmanAlHamali/flutter_typeahead ref: eb2f7633c1c58ed24844f809b2c4fa56faeb16e5 get_it: ^7.7.0 intl: ^0.19.0ng_animation_widget loading_animation_widget: ^1.2.1 mime: ^1.0.6 package_info_plus: ^8.0.2 shared_preferences: ^2.2.3 timelines: ^0.1.0 url_launcher: ^6.3.1
@EchoEllet @Abolfazlnezami2000 I had a crash occurring to me after migrating from my own fork of flutter_quill
to version 10.8.5
. I turns out that GeneratedPluginRegistrant.m
tried registering FlutterKeyboardVisibilityPlugin
twice. I had a dependency to flutter_keyboard_visibility
and flutter_quill has it's own fork of it, but both register their respective plugins under the same name, therefore this crash had occurred.
I temporarily removed flutter_keyboard_visibility
from the project and I'm relying on flutter_keyboard_visibility_temp_fork
for now.
Part of GeneratedPluginRegistrant.m
that caused the crash:
[FlutterKeyboardVisibilityPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterKeyboardVisibilityPlugin"]];
[FlutterKeyboardVisibilityPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterKeyboardVisibilityPlugin"]];
You can find it in project/ios/Runner/GeneratedPluginRegistrant.m
.
@Abolfazlnezami2000 When the app crashes you get a crash log on that you can preview, I reviewed my own and it clearly pointed to the line where FlutterKeyboardVisibilityPlugin
was getting re-registered. You can check your own to get further details onto what's going on.
I turns out that
GeneratedPluginRegistrant.m
tried registeringFlutterKeyboardVisibilityPlugin
twice. I had a dependency toflutter_keyboard_visibility
and flutter_quill has it's own fork of it, but both register their respective plugins under the same name, therefore this crash had occurred.
Thanks for the details.
This issue doesn't occur with desktop platforms, including macOS, unlike the iOS and Android implementations, which are within the same package for both the fork and the upstream package.
The collision can happen between those packages for Android, iOS, and the web. Depending on how the plugins are loaded in the platform, they can either crash or cause unexpected behavior such as using one of the platform implementations for both packages. This is a minor issue, there are not much of differences between the two.
flutter_keyboard_visibility
still hasn't been updated.flutter_keyboard_visibility_temp_fork
and use flutter_keyboard_visibility
in the flutter_quill
, this will revert the WASM compilation fix and the Android compile SDK issue. Will avoid this solution.flutter_quill
in quill_native_bridge
to access the keyboard visibility and remove flutter_keyboard_visibility_temp_fork
. Adding more features is on hold due to numerous TODOs in quill_native_bridge and the need for solid test coverage.flutter_keyboard_visibility_temp_fork
. The easiest though it will force updating the generated class GeneratedPluginRegistrant
for all clients with the latest version.I prefer solution 3 though will likely do 4 or 1 for the current time.
See the plugin platforms section in pubspec.yaml
of the flutter_keyboard_visibility_temp_fork
package.
. You can check your own to get further details onto what's going on.
@Abolfazlnezami2000 Can you confirm if you have `flutter_keyboard_visibilityin your
pubspec.yaml`?
Hi, I just bumped into this problem while updating dependencies. I can confirm that my app stops working (won't start) on iOS when I have both the latest flutter_keyboard_visibility
and flutter_quill
packages.
I didn't get any useful errors on VSCode console, but while running the project from Xcode I got this: "Duplicate plugin key: FlutterKeyboardVisibilityPlugin"
.
Replacing flutter_keyboard_visibility
with flutter_keyboard_visibility_temp_fork
in my pubspec.yaml
and changing imports accordingly fixed the issue and I was able to run the app.
. You can check your own to get further details onto what's going on.
@Abolfazlnezami2000 Can you confirm if you have `flutter_keyboard_visibility
in your
pubspec.yaml`?
I checked my project, and I don’t have the flutter_keyboard_visibility package listed in my pubspec.yaml. However, I am using the flutter_typeahead package, which internally uses flutter_keyboard_visibility.
I fixed the issue by updating the platform plugin name to a different name for Android, iOS, and Web even when you're using both flutter_keyboard_visibility
and flutter_keyboard_visibility_temp_fork
. Desktop platforms don't have this issue.
Can you test and see if the issue exists after using the latest pre-release with the following in your pubspec.yaml
:
# TODO: To fix https://github.com/singerdmx/flutter-quill/issues/2346
dependency_overrides:
flutter_keyboard_visibility_temp_fork: 0.1.2-alpha
I already tested it though to double-check. I will publish it as stable once you confirm.
Update: Run flutter pub upgrade
instead.
I have another package that depends on flutter_keyboard_visibility, this is why the collision occurs.
build/flutter_keyboard_visibility/intermediates/runtime_library_classes_jar/debug/classes.jar: R8: Type com.jrai.flutter_keyboard_visibility.BuildConfig is defined multiple times: /Users/loic/chairwatch/chairwatch_flutter/build/flutter_keyboard_visibility/intermediates/runtime_library_classes_jar/debug/classes.jar:com/jrai/flutter_keyboard_visibility/BuildConfig.class, /Users/loic/chairwatch/chairwatch_flutter/build/flutter_keyboard_visibility_temp_fork/intermediates/runtime_library_classes_jar/debug/classes.jar:com/jrai/flutter_keyboard_visibility/BuildConfig.class
Thanks @EchoEllet, I confirm that your fix seems to work for me (tested on iOS).
I have another package that depends on flutter_keyboard_visibility, this is why the collision occurs.
Can you try using the pre-release version of flutter_keyboard_visibility_temp_fork
?
I confirm that your fix seems to work for me (tested on iOS).
Thanks for confirming. I will publish it as stable soon.
Fixed and published as stable, run flutter pub upgrade
. It's no longer required to remove flutter_keyboard_visibility
or override the version.
Is there an existing issue for this?
Flutter Quill version
10.8.5
Steps to reproduce
added package in yaml and try to build project. flutter doctor: Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.3, on macOS 15.1 24B83 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.2) [✓] VS Code (version 1.95.1) [✓] Connected device (5 available) [✓] Network resources
• No issues found!
Expected results
build
Actual results
crash
Additional Context
Screenshots / Video demonstration
[Upload media here]Logs
```console [https://pastebin.com/0DfQN44b](simulator logs) ```