-
-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to get location #44
Comments
I'm having the same error... Any update on this? |
Any update on this issue ? |
Same here. I am accepting the permission request but PERMISSION_DENIED is always thrown and returns location null |
Strangely, the onLocationChanged Stream works |
Bit more info... I've two apps, one that uses the onLocationChanged listener and one that simply calls getLocation once. On a fresh phone boot I get the same error calling getLocation. If I then run the other app that uses the onLocationChanged listener, then the first app's call to getLocation starts working. |
Same here. I started having the problem after I had added the image_picker dependecy which made me accept the permission request to use location for pictures. |
Same here, any update? |
Will there be any updates on this? |
Someone want to put up an example that can be used to test that fails ? May be good to isolate if it's a problem with the package, or some phones or whatever/ |
I get this issue if I disable wifi in the simulator. I wanted to test my app at different network speeds and latencies, but it won't start with wifi off due to this error when calling |
Does pubspec order dependency matter? What happens if 'location' is included before 'image_picker'? |
'location' was already before 'image_picker', but I didn't think to try switching them the other way. I've changed to 'geolocator' which seems to be working fine initially - time will tell. I'll update if I decide to try switching them around. |
any update on this? |
'getLocation' uses 'getLastLocation()' on Android which can return null in a number of scenarios. I had a attempt at fixing this here 6666cf8 |
I've updated 6666cf8 and it seems to be working fine. Anyone who wants to test can use dependencies: |
Will there be any update on this? |
Hey, its supposed to be corrected in the last version, pls check this. |
@Lyokone I tried your suggestions. Yet it doesn't work. My dependencies on android/build.gradle are
` My Gradle.properties on android/gradle.properties are: android.useAndroidX=true android.enableJetifier=true Is there any other way? |
@Lyokone the only thing I get is PlatformException(ERROR, Failed to get location., null) exception Any idea? |
Are you compiling against the version 28 of the SDK ? Do you also have added all the permission the application needs ? |
`
And this:
I think I am all set |
@Lyokone depicted above |
Any news on this, anybody? |
I surrender with this error, and change it to this + permission library |
Hey, version 2.1 should help you get more consistent results, pls check it out and reopen if its still not fixed. |
i just updated to the 2.1.0 version and i still have this problem on my android emulator |
It's still an ongoing issue. Even the documentation is misleading. |
Same error, any solution yet? |
any progress? update? same error |
I'm getting the error when it calls
.invokeMethod('getLocation')
Future<Map<String, double>> get getLocation => _channel
.invokeMethod('getLocation')
.then((result) => result.cast<String, double>());
inside location.dart.
The message error is "Failed to get location"
The app asks for permition.
=============================================
(build.gradle)
buildscript {
repositories {
google()
jcenter()
}
}
============================================
(pubspec.yaml)
dependencies:
flutter:
sdk: flutter
image_picker: 0.4.1
google_sign_in: 3.0.2
firebase_analytics: 0.3.3
firebase_auth: 0.5.5
firebase_database: 0.4.6
firebase_storage: 0.3.0
cached_network_image: "^0.4.1"
rxdart: ^0.16.7
cupertino_icons: ^0.1.0
photo_view: 0.0.2
flutter_map: ^0.0.1
location: 1.3.3
geohash: 0.1.1
==============================================
(messages)
The text was updated successfully, but these errors were encountered: