NativeScript / nativescript-geolocation

Geolocation plugin to use for getting current location, monitor movement, etc
Apache License 2.0
139 stars 76 forks source link

Application crashes when using the plugin to get location geoLocation.isEnabled() #269

Closed ajdadj1987 closed 4 years ago

ajdadj1987 commented 4 years ago

Which platform(s) does your issue occur on?

I'm trying to use this plugin for my app. I need the lat and long of my current position. Demo code works perfect for angular.

When i run my angular app using geo-location, i'm calling below as per demo.

geoLocation.isEnabled().then(function (isEnabled) {

I do get a pop up but when i click allow when using the app, it crashes without error and upon debugging i found it crashes in below code of the plug-in.

let mLocationRequest = new com.google.android.gms.location.LocationRequest();

Please advise. Thank you

codeturn commented 4 years ago

Same bug then "nativescript-google-maps-sdk" in dependencies. Looks as conflict with google maps sdk.

geek3000 commented 4 years ago

Same bug

ajdadj1987 commented 4 years ago

Looks like mine was resolved upon resolving Google Play Services version. In order to fix this you might pin the version number in your app/App_Resources/Android/before-plugins.gradle file (if the file does not exist, just create it):

android {
// other stuff here

project.ext { googlePlayServicesVersion = "16.+" } }

I hope it does for you as well.

Good Luck @codeturn @geek3000 !!