flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

Incompatible with Flutter 3.0 (Android)

Open robert-virkus opened this issue 4 years ago • 9 comments

Describe the bug

The plugin cannot compiled for Android with Flutter 3.0. Perhaps this affects iOS, too. Yes, I tried running flutter clean first.

Expected behavior The plugin compiles.

Tested on:

  • Compile time error

Other plugins:

  • List of others Flutter plugins that could interfere

Additional logs

e: C:\Users\User\flutter\.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: C:\Users\User\flutter\.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:compileReleaseKotlin'.
> Compilation error. See log for more details

robert-virkus avatar May 11 '22 20:05 robert-virkus

any update, guys?

rawquesh avatar May 12 '22 14:05 rawquesh

please do update guys? as soon as

mitesh77 avatar May 12 '22 15:05 mitesh77

This was what I followed to fix it.

Temporary fix: Search for the FlutterLocationService.kt and edit it change override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?): Boolean to

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean

vikilinho avatar May 12 '22 15:05 vikilinho

This was what I followed to fix it.

Temporary fix: Search for the FlutterLocationService.kt and edit it change override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?): Boolean to

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean

You have to add array type Array<out String> (as you said Temporary fix ) override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray): Boolean

SalarPro avatar May 12 '22 20:05 SalarPro

This was what I followed to fix it.

Temporary fix: Search for the FlutterLocationService.kt and edit it change override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?): Boolean to

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean

whats the directory?

noahvelasco avatar May 12 '22 21:05 noahvelasco

This was what I followed to fix it. Temporary fix: Search for the FlutterLocationService.kt and edit it change override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?): Boolean to override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean

whats the directory? mine is this "C:\Users\<YOUR_PC_USER>\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.3.0\android\src\main\java\com\lyokone\location\FlutterLocationService.kt"

SalarPro avatar May 13 '22 00:05 SalarPro

@Lyokone This sounds like a rather urgent change. Would you be able to review, merge, and release this patch?

zmeggyesi avatar May 13 '22 10:05 zmeggyesi

Hey, sorry not having a lot of time to maintain the package right now, should improve soon 🤞 I'm looking at that now

Lyokone avatar May 13 '22 15:05 Lyokone

It's published in 4.4.0 Thanks for your help

Lyokone avatar May 13 '22 15:05 Lyokone