在FLutter 3.0中使用pay包实现gpay时遇到错误。
e: /Users/karmaln/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/pay_android-1.0.6/android/src/main/kotlin/io/flutter/plugins/pay_android/PayMethodCallHandler.kt: (50, 69): Type mismatch: inferred type is Activity? but Activity was expected
e: /Users/karmaln/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/pay_android-1.0.6/android/src/main/kotlin/io/flutter/plugins/pay_android/PayMethodCallHandler.kt: (69, 74): Type mismatch: inferred type is String? but String was expected
e: /Users/karmaln/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/pay_android-1.0.6/android/src/main/kotlin/io/flutter/plugins/pay_android/PayMethodCallHandler.kt: (73, 34): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
e: /Users/karmaln/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/pay_android-1.0.6/android/src/main/kotlin/io/flutter/plugins/pay_android/PayMethodCallHandler.kt: (74, 34): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Map<String, Any>?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':pay_android: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 30s
Exception: Gradle task assembleDebug failed with exit code 1
我想实现googlepay和Apple使用pay: ^1.0.8包
项目中使用的kotlin版本:ext.kotlin_version = '1.6.10'
min SDK版本:minSdkVersion 21
打开项目级别构建。然后将ext.kotlin_version = '1.4.32'替换为新版本。