openimsdk / open-im-flutter-demo

Demo developed based on flutter open IM SDK.
https://openim.io
Apache License 2.0
310 stars 209 forks source link

[BUG] openim_common/lib/src/widgets/chat/chat_input_box.dart:225:21: Error: Final field 'onClearQuote' is not initialized. #115

Closed bright87 closed 3 months ago

bright87 commented 3 months ago

OpenIM Server Version

当前版本,找不到你们的版本号

Operating System and CPU Architecture

Windows (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

环境说明

系统:Windows 10 专业版,64位。 Android studio:Android Studio Koala | 2024.1.1 Patch 1 Java:java 21.0.4 2024-07-16 LTS flutter:3.22.3,flutter用FVM进行安装和管理的

报错内容

通过Android studio运行项目时报错

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

Checking the license for package Android SDK Tools in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Tools accepted.
Preparing "Install Android SDK Tools (revision: 26.1.1)".
"Install Android SDK Tools (revision: 26.1.1)" ready.
Installing Android SDK Tools in C:\Users\bright\AppData\Local\Android\Sdk\tools
"Install Android SDK Tools (revision: 26.1.1)" complete.
"Install Android SDK Tools (revision: 26.1.1)" finished.
Checking the license for package Android SDK Build-Tools 30.0.3 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Build-Tools 30.0.3 accepted.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in C:\Users\bright\AppData\Local\Android\Sdk\build-tools\30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Checking the license for package Android SDK Platform 28 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
Checking the license for package Android SDK Platform 34 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 34 accepted.
Preparing "Install Android SDK Platform 34 (revision: 3)".
"Install Android SDK Platform 34 (revision: 3)" ready.
Installing Android SDK Platform 34 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-34
"Install Android SDK Platform 34 (revision: 3)" complete.
"Install Android SDK Platform 34 (revision: 3)" finished.
Checking the license for package Android SDK Platform 33 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision: 3)".
"Install Android SDK Platform 33 (revision: 3)" ready.
Installing Android SDK Platform 33 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-33
"Install Android SDK Platform 33 (revision: 3)" complete.
"Install Android SDK Platform 33 (revision: 3)" finished.
Checking the license for package Android SDK Platform 29 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 5)".
"Install Android SDK Platform 29 (revision: 5)" ready.
Installing Android SDK Platform 29 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-29
"Install Android SDK Platform 29 (revision: 5)" complete.
"Install Android SDK Platform 29 (revision: 5)" finished.
Checking the license for package Android SDK Platform 31 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision: 1)".
"Install Android SDK Platform 31 (revision: 1)" ready.
Installing Android SDK Platform 31 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-31
"Install Android SDK Platform 31 (revision: 1)" complete.
"Install Android SDK Platform 31 (revision: 1)" finished.
Checking the license for package Android SDK Platform 30 in C:\Users\bright\AppData\Local\Android\Sdk\licenses
License for package Android SDK Platform 30 accepted.
Preparing "Install Android SDK Platform 30 (revision: 3)".
"Install Android SDK Platform 30 (revision: 3)" ready.
Installing Android SDK Platform 30 in C:\Users\bright\AppData\Local\Android\Sdk\platforms\android-30
"Install Android SDK Platform 30 (revision: 3)" complete.
"Install Android SDK Platform 30 (revision: 3)" finished.
openim_common/lib/src/widgets/chat/chat_input_box.dart:225:21: Error: Final field 'onClearQuote' is not initialized.
Try to initialize the field in the declaration or in every constructor.
  final Function()? onClearQuote;
                    ^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script 'C:\workspace\flutter\open-im-flutter-demo\.fvm\flutter_sdk\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1629

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\workspace\flutter\open-im-flutter-demo\.fvm\flutter_sdk\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10m 37s
Error: Gradle task assembleDebug failed with exit code 1

其它报错

有些目录总是提示 ‘Pub get' has not been run。 我在项目根目录已经运行过’fvm flutter pub get‘了。

截图

flutter-error

Screenshots Link

No response

std-s commented 3 months ago

I don't know how you did it, but it does exist in the code.