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

4 Answers 4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

This solution worked for me, just deleted all the folder packages listed in the error.
doesn't solve the error for me
Did not work for me. These errors started happening after I upgraded to Flutter 3
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

1 Comment

it works for me, updating version and adding minSdkVersion to 20, thx!
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"/>

8 Comments

Already added while adding new pulgin(location) in pubsec.yaml it shows this error
Then just change the Kotlin version in Android -> build.gradle file.
ext.kotlin_version = '1.6.10' like this.
it is also same as ext.kotlin_version = '1.6.10'
1. flutter clean 2. Delete android/.gradle
|
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

2 Comments

im not working in text to speech library in flutter
Whoops !! I got the same errors with text speech In that case, just update from location: x.x.x to location: ^4.4.0, merely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.