Execution failed for task ‘:keyboard_utils:compileDebugKotlin‘.

Execution failed for task ':keyboard_utils:compileDebugKotlin'.

这个错误是keyboard_utils依赖报错。

这个问题在keyboard_utils github项目的issues 有记载Project does not run with new Flutter 2.10.0

详细错误信息:

typescript 复制代码
e: /Users/andreifufylev/development/flutter/.pub-cache/hosted/pub.dartlang.org/keyboard_utils-1.3.3/android/src/main/kotlin/br/com/keyboard_utils/manager/KeyboardUtils.kt: (56, 40): Using 'max(): T?' is an error. Use maxOrNull instead.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':keyboard_utils:compileDebugKotlin'.
> Compilation error. See log for more details

* 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 24s
Exception: Gradle task assembleDevelopmentDebug failed with exit code 1

解决方式:

1.建议使用1.3.4版本。

2.从写该依赖的handleKeyboard()方法:

typescript 复制代码
override fun handleKeyboard() {
        keyboardSessionTimer = object : CountDownTimer(150, 1) {
            override fun onFinish() {
                keyboardSessionHeights.maxOrNull().let {
                    if (it!! > 0 && lastKeyboardHeight!! != it!!) {
相关推荐
心中有国也有家5 小时前
AtomGit Flutter 鸿蒙客户端: ChangeNotifier 模式
学习·flutter·华为·harmonyos
浮江雾15 小时前
Flutter第三节----Dart中的数据类型
android·开发语言·学习·flutter·入门·函数
又菜又爱coding15 小时前
Flutter Android 无线调试No supported devices connected
flutter
心中有国也有家17 小时前
AtomGit Flutter 鸿蒙客户端:初始化流水线
学习·flutter·华为·harmonyos
ZZZMMM.zip1 天前
基于鸿蒙HarmonyOS NEXT开发AI英语口语应用:智能口语练习新体验与鸿蒙Flutter框架跨端实
人工智能·flutter·华为·harmonyos·鸿蒙·鸿蒙系统
心中有国也有家1 天前
AtomGit Flutter 鸿蒙客户端:白噪音场景的视觉设计
学习·flutter·华为·harmonyos
心中有国也有家1 天前
AtomGit Flutter 鸿蒙客户端:呼吸练习的完整生命周期
学习·flutter·华为·harmonyos
心中有国也有家1 天前
AtomGit Flutter 鸿蒙客户端:呼吸球动画
学习·flutter·华为·harmonyos
心中有国也有家2 天前
AtomGit Flutter 鸿蒙客户端:呼吸练习的三种科学模式
学习·flutter·华为·harmonyos
yuanlaile2 天前
前端转 Flutter 自学完整规划,避开跨栈思维转换误区
前端·flutter·flutter跨平台开发