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

Compatibility Issue with HarmonyOS has error #2389

Open
1 task done
shanshen6 opened this issue Nov 21, 2024 · 2 comments
Open
1 task done

Compatibility Issue with HarmonyOS has error #2389

shanshen6 opened this issue Nov 21, 2024 · 2 comments
Labels
deferred This issue is not a current priority and will not be addressed in the near future. enhancement New feature or request minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function

Comments

@shanshen6
Copy link

shanshen6 commented Nov 21, 2024

Is there an existing issue for this?

Use case

https://gitee.com/harmonycommando_flutter/flutter

flutter build hap

Error output

start hap build...
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:269:13:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
    switch (defaultTargetPlatform) {
            ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:479:13:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
    switch (defaultTargetPlatform) {
            ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:625:13:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
    switch (defaultTargetPlatform) {
            ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:679:15:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
      switch (defaultTargetPlatform) {
              ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:693:15:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
      switch (defaultTargetPlatform) {
              ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:803:17:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
        switch (defaultTargetPlatform) {
                ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/delegate.dart:843:15:
Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't match
'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
      switch (defaultTargetPlatform) {
              ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/text/text_selection.da
rt:911:13: Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't
match 'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
    switch (defaultTargetPlatform) {
            ^
../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_quill-10.8.5/lib/src/editor/widgets/text/text_selection.da
rt:1068:15: Error: The type 'TargetPlatform' is not exhaustively matched by the switch cases since it doesn't
match 'TargetPlatform.ohos'.
 - 'TargetPlatform' is from 'package:flutter/src/foundation/platform.dart'
 ('../../../ohos/flutter/packages/flutter/lib/src/foundation/platform.dart').
Try adding a default case or cases that match 'TargetPlatform.ohos'.
      switch (defaultTargetPlatform) {
              ^
Target kernel_snapshot failed: Exception
#0      KernelSnapshot.build (package:flutter_tools/src/build_system/targets/common.dart:279:7)
<asynchronous suspension>
#1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)
<asynchronous suspension>
#2      Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#4      Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#6      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)
<asynchronous suspension>
#7      flutterAssemble (package:flutter_tools/src/ohos/hvigor.dart:306:32)
<asynchronous suspension>
#8      OhosHvigorBuilder.flutterBuildPre (package:flutter_tools/src/ohos/hvigor.dart:543:27)
<asynchronous suspension>
#9      OhosHvigorBuilder.buildApplicationPipeLine (package:flutter_tools/src/ohos/hvigor.dart:681:5)
<asynchronous suspension>
#10     OhosHvigorBuilder.buildHap (package:flutter_tools/src/ohos/hvigor.dart:479:5)
<asynchronous suspension>
#11     BuildHapCommand.runCommand (package:flutter_tools/src/commands/build_hap.dart:80:5)
<asynchronous suspension>
#12     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#14     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#15     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
<asynchronous suspension>
#16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#17     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
<asynchronous suspension>
#18     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#19     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#20     main (package:flutter_tools/executable.dart:93:3)
<asynchronous suspension>

Error: Failed to compile application for the Ohos.
Running Hvigor task assembleHap...       

Proposal

Dear Flutter Quill Team,

We are currently using Flutter Quill as a cross-platform editor in our project. However, we have encountered several issues when trying to adapt it for HarmonyOS. Specifically, when running the flutter build hap command, we are faced with numerous errors that prevent us from successfully building the application for HarmonyOS.

Steps to Reproduce:

Set up a Flutter project with Flutter Quill as a dependency.
Attempt to build the project for HarmonyOS using the flutter build hap command.
Observe the errors that occur during the build process.

Expected Behavior:

The project should build successfully for HarmonyOS without any errors.

Actual Behavior:

The build process fails with multiple errors, indicating compatibility issues with HarmonyOS.

Error Logs:

(Include any relevant error logs or screenshots here)

Environment:

Flutter version: (include your Flutter version here)
Dart version: (include your Dart version here)
Flutter Quill version: (include the version of Flutter Quill you are using)
HarmonyOS version: (include the version of HarmonyOS you are targeting)

Additional Context:

We believe that resolving these compatibility issues would greatly benefit the Flutter community, as it would enable more developers to use Flutter Quill in their HarmonyOS projects. We would appreciate any assistance or guidance you can provide to help us overcome these challenges.

Thank you for your attention to this matter. We look forward to your response.

Best regards,

@shanshen6 shanshen6 added the enhancement New feature or request label Nov 21, 2024
@shanshen6
Copy link
Author

image Dear Flutter Quill Team,

We are currently using Flutter Quill as a cross-platform editor in our project. However, we have encountered several issues when trying to adapt it for HarmonyOS. Specifically, the delegate.dart file does not seem to be fully compatible with HarmonyOS. When running the flutter build hap command, we encounter numerous errors related to the lack of support for TargetPlatform.ohos.

Details:

File: delegate.dart
Issue: The file does not handle TargetPlatform.ohos in various switch statements, leading to build errors when targeting HarmonyOS.
Example:
In the onTapDown method, the TargetPlatform.ohos case is missing.
In the onDragSelectionUpdate method, the TargetPlatform.ohos case is not properly handled.
Steps to Reproduce:

Set up a Flutter project with Flutter Quill as a dependency.
Attempt to build the project for HarmonyOS using the flutter build hap command.
Observe the errors that occur during the build process.
Expected Behavior:

The project should build successfully for HarmonyOS without any errors.

Actual Behavior:

The build process fails with multiple errors, indicating compatibility issues with HarmonyOS.

Error Logs:

(Include any relevant error logs or screenshots here)

Environment:

Flutter version: (include your Flutter version here)
Dart version: (include your Dart version here)
Flutter Quill version: (include the version of Flutter Quill you are using)
HarmonyOS version: (include the version of HarmonyOS you are targeting)

Additional Context:

We believe that resolving these compatibility issues would greatly benefit the Flutter community, as it would enable more developers to use Flutter Quill in their HarmonyOS projects. We would appreciate any assistance or guidance you can provide to help us overcome these challenges.

Thank you for your attention to this matter. We look forward to your response.

Best regards,

@EchoEllet EchoEllet added minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function deferred This issue is not a current priority and will not be addressed in the near future. labels Nov 21, 2024
@mny459
Copy link

mny459 commented Nov 22, 2024

Same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred This issue is not a current priority and will not be addressed in the near future. enhancement New feature or request minor Minimal impact or cosmetic issue. Can be resolved at a later time without affecting overall function
Projects
None yet
Development

No branches or pull requests

3 participants