singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 839 forks source link

pod install error related to quill_native_bridge #2316

Closed CherishMvp closed 1 month ago

CherishMvp commented 1 month ago

Is there an existing issue for this?

Flutter Quill version

No response

Steps to reproduce

image

一运行就会立马闪退,随后报错。“-[FlutterEngine registrarForPlugin:], FlutterEngine.mm:1338 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: QuillNativeBridgePlugin'” 插件版本:
flutter_quill: ^10.7.0 flutter_quill_extensions: ^10.7.0 不使用这些插件我是运行正常的项目。

Xcode build done. 95.6s (lldb) 2024-10-15 08:04:11.958526+0800 Runner[1217:367695] Assertion failure in -[FlutterEngine registrarForPlugin:], FlutterEngine.mm:1338 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: QuillNativeBridgePlugin' *** First throw call stack: (0x18a994cb4 0x183a343d0 0x18512a54c 0x10897df9c 0x1025f4634 0x1025f48f4 0x1025f4be4 0x18cd4f054 0x18cd4e78c 0x18cd4d768 0x18cd4d3b4 0x18ca95664 0x18cdd3850 0x18cc85c5c 0x18cc85a84 0x18cc85634 0x18cc85500 0x18d372a68 0x18d411074 0x18cb32c70 0x18cfa41ac 0x18cc03c60 0x18cc03ad0 0x18cc03028 0x18cc02db4 0x1a0a102e4 0x1a0a50068 0x1a0a14120 0x1a0a4fcc0 0x191e5beac 0x191e5f91c 0x1a0a1e24c 0x1a0a1dde8 0x1a0a20694 0x18aa5e128 0x18aa6a7b4 0x18a9ef5e8 0x18aa050d4 0x18aa0a3ec 0x1c5f2035c 0x18cd96f58 0x18cd96bbc 0x1934240b0 0x1025f4d88 0x1025f4d00 0x1025f4e04 0x1a9f3cdec) libc++abi: terminating due to uncaught exception of type NSException

Expected results

正常运行调试

Actual results

闪退崩溃

Additional Context

Screenshots / Video demonstration [Upload media here]
Logs ```console [Paste your logs here] ```
CherishMvp commented 1 month ago

when i use the default latest version: flutter_quill_extensions: ^10.8.2 flutter_quill: ^10.7.6 occurre: ❯ pod install Analyzing dependencies [!] No podspec found for quill_native_bridge_platform_interface in .symlinks/plugins/quill_native_bridge_platform_interface/ios such as flutter clean && flutter pub get xxxxx not useful

CherishMvp commented 1 month ago

the xcode shows

image
EchoEllet commented 1 month ago

Related #2230 but not merged yet, I have updated the pubspec.yaml to avoid using newer versions of thequill_native_bridge plugin.

Can you tell me which version you're able to reproduce the issue and which version didn't have the issue? Have you encountered it recently? Steps to reproduce, and can you encounter this issue in the example app of Flutter Quill?

Also, can you try:

dependency_overrides:
  flutter_quill:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: feat/default-clipboard-native-impl
CherishMvp commented 1 month ago

There was no problem with flutter on android. I found that my mac version of Flutter was 3.24.0 while windows was 3.24.3. When I upgraded to the latest version 3.24.3, I found that the issue was no longer there and it worked fine on ios devices. So regardless of flutter_quill version 10.x, the issue of needing to upgrade flutter under mac will not exist

CherishMvp commented 1 month ago

As for your minimal instance demo, using flutter version 3.24.0, you can install flutter_quill_extensions and flutter_quill directly using flutter pub get, and this will happen under ios

EchoEllet commented 1 month ago

There was no problem with flutter on android. I found that my mac version of Flutter was 3.24.0 while windows was 3.24.3

This issue is related to iOS and specific to Xcode/Apple ecosystem, which is unsupported on Windows, so it's likely irrelevant.

If it's a bug with quill_native_bridge, then it's most likely a platform-specific configuration issue with the iOS plugin.

the issue of needing to upgrade flutter under mac will not exist

The issue is with the plugin quill_native_bridge. Since version 10.6.2 is used in the latest version of flutter_quill, we have changes in #2230 that are unpublished yet.

Can you try with this branch and see if the issue encountered:

dependency_overrides:
  flutter_quill:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: feat/default-clipboard-native-impl

you can install flutter_quill_extensions

AFAIK, the extensions package should not cause this build failure since the issue is with quill_native_bridge, which is a dependency of flutter_quill. Does removing the flutter_quill_extensions fix the encountered issue?

CherishMvp commented 1 month ago

I'll try it later

EchoEllet commented 1 month ago

I was able to encounter the issue of an outdated app with #2230

The issue is that Podfile is outdated with newer versions of Flutter, specifically this line caused the issue in the Podfile:

platform :ios, '12.0'

To fix the issue:

flutter clean && flutter pub get && flutter pub upgrade
cd ios
rm Podfile && rm Podfile.lock
pod install --repo-update

The part that fixes the issue is to remove both Podfile and Podfile.lock (from your ios directory) and then once you run the app, Flutter CLI will generate those files once again, double-check if you have a custom configuration in Podfile since they will be undone.

The issue flutter_keyboard_visibility #52 is very similar (thanks to them, was able to identify the issue faster), it doesn't appear to be a bug from quill_native_bridge_ios, it's likely Podfile configuration issue, The error can sometimes be irrelevant or not quite specific.

EchoEllet commented 1 month ago

I encountered the issue again in the example app and once again on that outdated app, it appears quill_native_bridge_platform_interface implemented the iOS plugin which is probably a regression and wasn't an issue before the split and moved each platform implementation into its package, the platform interface doesn't implement any platform itself, this part was causing the issue.

Run flutter pub upgrade and the issue should be fixed.

EchoEllet commented 1 month ago

I'll try it later

Can you confirm if the issue is fixed (after running flutter pub upgrade and updating your Podfile if it was outdated)?

CherishMvp commented 1 month ago

I think the issue should be on dead flutter version thanks。 by the way. how to preview quill json format content in a widget

EchoEllet commented 1 month ago

how to preview quill json format content in a widget

I'm not quite sure. Do you mean parsing the JSON and loading it as a document or a widget that provides a visual preview? For JSON, there are many packages, though specifically for JSON Delta. I don't think there is a flutter package.