任务“:location:compileDebugKotlin”执行失败

Dar*_*369 3 flutter fluttermap flutter-android

任务“:location:compileDebugKotlin”执行失败。

运行 Gradle 任务 'assembleDebug'... e: /Users/apple/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/android/src/main/java/com/lyokone/location/FlutterLocationService .kt: (124, 1): 类 'FlutterLocationService' 不是抽象的,也没有实现抽象成员 public Abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean 定义于io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener e:/Users/apple/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/android/src/main/java/com/lyokone/location /FlutterLocationService.kt: (258, 5): 'onRequestPermissionsResult' 不覆盖任何内容

失败:构建失败并出现异常。

  • 出了什么问题:任务“:location:compileDebugKotlin”执行失败。

编译错误。查看日志了解更多详情

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

  • 在https://help.gradle.org获取更多帮助

4 秒内构建失败异常:Gradle 任务 assembleDebug 失败,退出代码为 1

小智 6

请转到此位置 -> Users/apple/.pub-cache/hosted/pub.dartlang.org,剪切/移动 location-4.3.0 文件夹并将其粘贴到某处,然后运行您的应用程序,它应该可以解决问题。


小智 5

我认为这是由于版本与包不匹配造成的。就我而言,通过将软件包版本更改为最新版本解决了这个问题。

- location: ^4.3.0
+ location: ^4.4.0
Run Code Online (Sandbox Code Playgroud)