任务“:location:compileDebugKotlin”执行失败
任务“: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): 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 运行以获得完整的见解。
- 获取更多帮助
4 秒内构建失败 异常:Gradle 任务 assembleDebug 失败,退出代码为 1
Execution failed for task ':location:compileDebugKotlin'.
Running Gradle task '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): Class 'FlutterLocationService' 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: /Users/apple/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/android/src/main/java/com/lyokone/location/FlutterLocationService.kt: (258, 5): 'onRequestPermissionsResult' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':location: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 4s
Exception: Gradle task assembleDebug failed with exit code 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请前往此位置 -> Users/apple/.pub-cache/hosted/pub.dartlang.org,剪切/移动 location-4.3.0 文件夹并将其粘贴到某处,然后运行您的应用程序,它应该可以解决问题。
Please go to this location -> Users/apple/.pub-cache/hosted/pub.dartlang.org, cut/move the location-4.3.0 folder and paste it somewhere, run your application afterwards and it should solve the problem.
我认为这是由于版本与包不匹配造成的。就我而言,通过将软件包版本更改为最新版本解决了这个问题。
I think this is due to version mismatch with the package. In my case, it was solved by changing the package version to latest version.
只需确保您已在 AndroidManifest 文件中添加位置权限即可。
如果没有,请在 main -> 添加这些权限AndroidManifest.xml ,
Just make sure that you have added location permissions in AndroidManifest file.
if not, add these permissions in main -> AndroidManifest.xml ,
就我而言,我这样做了:
然后在命令行中
,在 pubspec.yaml 内
最后,它对我有用
NB: 如果您遇到任何问题,您可以将 location: xxx 更新为 location: ^4.4.0
In my case I did this:
In command line
then, inside pubspec.yaml
Finally, it worked for me
NB: If you encounter any problem, you may update location: x.x.x to location: ^4.4.0