在flutter升级到3.0.2后,构建flutter应用失败



在颤振升级到3.0.2后出现此错误

.pub-cache/hosted/pub.dartlang.org/flutter_archive-4.1.1/android/src/main/kotlin/com/kineapps/flutterarchive/FlutterArchivePlugin.kt: (370, 58): Object is not abstract and does not implement abstract member public abstract fun error(p0: String, p1: String?, p2: Any?): Unit defined in io.flutter.plugin.common.MethodChannel.Result
.pub-cache/hosted/pub.dartlang.org/flutter_archive-4.1.1/android/src/main/kotlin/com/kineapps/flutterarchive/FlutterArchivePlugin.kt: (387, 17): 'error' overrides nothing

颤振的医生

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.1 21C52 darwin-arm, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

error()的签名已经更改,因此您正在使用的flutter_archive版本不再工作。在FlutterArchivePlugin.kt中重写了这个方法。

flutter_archive的开发者已经修复了这个问题,所以一个插件的更新应该是足够的。

旧:

fun error(code: String?, msg: String?, details: Any?)

新:

fun error(code: String, msg: String?, details: Any?)

最新更新