3

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

Dark_Clouds_369
  • 658
  • 1
  • 6
  • 24

4 Answers4

6

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.

5

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.

- location: ^4.3.0
+ location: ^4.4.0
Zeyar Paing
  • 261
  • 3
  • 6
1

Just make sure that you have added location permissions in AndroidManifest file. if not, add these permissions in main -> AndroidManifest.xml ,

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Maqsood
  • 807
  • 3
  • 14
0

In my case I did this: In command line

flutter clean && flutter pub get

then, inside pubspec.yaml

upgrade speech_to_text library from speech_to_text: ^5.4.0 to speech_to_text: ^5.5.0

Finally, it worked for me

NB: If you encounter any problem, you may update location: x.x.x to location: ^4.4.0

M E S A B O
  • 783
  • 1
  • 11
  • 15