尝试为background_location Flutter插件构建一个Android APK。由于某种原因,它给出了下面的错误。应用程序运行在ios模拟器上。
插件链接:https://pub.dev/packages/background_location/example
e: /Users/my-cpu/.pub-cache/hosted/pub.dartlang.org/background_location-0.8.1/android/src/main/kotlin/com/almoullim/background_location/BackgroundLocationService.kt: (23, 1): Class 'BackgroundLocationService' 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/my-cpu/.pub-cache/hosted/pub.dartlang.org/background_location-0.8.1/android/src/main/kotlin/com/almoullim/background_location/BackgroundLocationService.kt: (221, 5): 'onRequestPermissionsResult' overrides nothing
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':background_location:compileReleaseKotlin'.
1条答案
按热度按时间bihw5rsg1#
在BackgroundLocationService.kt中替换
override fun onRequestPermissionsResult(requestCode:Int,权限:数组?,grantResults:IntArray?):布尔
与
override fun onRequestPermissionsResult(requestCode:Int,权限:数组,grantResults:IntArray):Boolean