在将Flutter 升级到新的3.0.0之后,我发现qr\U code\U scanner库有问题

e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (23, 1): Class 'QRView' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (216, 26): Null can not be a value of a non-null type String
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (247, 26): Null can not be a value of a non-null type String
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt: (310, 5): 'onRequestPermissionsResult' overrides nothing
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (10, 1): Class 'QRViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /home/kalheeso/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-0.7.0/android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRViewFactory.kt: (13, 5): 'create' overrides nothing

FAILURE: Build failed with an exception.

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

推荐答案

使用备选方案mobile_scanner.此库在Flatter 3.0中不起作用.否则

dependency_overrides:
    qr_code_scanner:
        git:
            url: https://github.com/X-SLAYER/qr_code_scanner.git
            ref: flutter-beta

Java相关问答推荐

为什么使用JDK21获取锁定锁比使用JDK11慢

我可以在MacOS上使用什么Java函数来在适当的设备上以适当的音量播放适当的alert 声音?

Arrays.hashcode(int[])为不同的元素提供相同的散列

未找到适用于响应类型[类java.io.InputStream]和内容类型[Text/CSV]的HttpMessageConverter

使SLF4J在Android中登录到Logcat,在测试中登录到控制台(Gradle依赖问题)

try 从REST API返回对象列表时出错

Groovy/Java:匹配带引号的命令选项

在Frege中,我如何将一个字符串安全地转换为一个可能的Int?

Android Java:已设置但未读取SharedPreferences

当构造函数创建一个新实例时,Java为什么需要&new";

找出承载Cargo 的最小成本

从泛型枚举创建EnumMap

没有Tomcat,IntelliJ如何在本地运行API?

Java HashMap保留所有时间复杂性

message.acknowledge()没有';在使用Spring Boot在ActiveMQ中读取消息后,t将消息出列

ANTLR 接受特殊字符,例如 .标识符或表达式中的(点)和 ,(逗号)

人们在 IntelliJ 上将-Dhttp.proxyHost=your.proxy.net -Dhttp.proxyPort=8080放在哪里?

一条Java记录可以保存多少个字段?

我可以使用一个 PoolingNHttpClientConnectionManager 运行多个 HttpAsyncClient 吗?

如何在 IntelliJ 中获取 Visual Studio Code 的 Dark Modern Java colored颜色 语法