question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LocationRequest() from plugin crash the app [BUG]

See original GitHub issue

After I call this

Geolocation.enableLocationRequest().then(() => {
      Geolocation.getCurrentLocation({}).then(location => {
        console.log(location)
      }).catch(error => {
        console.log(error)
      });
  });

App just crash… No any log displayed after crush

Using nativescript 6.5.0 with Angular 8.0

I am using also Android device with wifi and geolocation on

UPDATE

After debugging I found line which crash the app it is 91 function _getLocationRequest(options) var mLocationRequest = new com.google.android.gms.location.LocationRequest()

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
neil-119commented, Jun 4, 2020

Adding on to vforv’s answer, I created a file called before-plugins.gradle in the same directory as app.gradle and added in the following content (NativeScript loads the file automatically):

android {
    project.ext { 
        googlePlayServicesVersion = "16.+"
    }
    dependencies {
        def googlePlayServicesVersion = project.googlePlayServicesVersion
        compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
    }
}

This solved it for me.

5reactions
vforvcommented, Apr 29, 2020

add this to the app.gradle

project.ext {
       googlePlayServicesVersion = "15.0.1"
}
dependencies {
   def googlePlayServicesVersion = project.googlePlayServicesVersion
   compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashing while implementing current location in android ...
App is getting crashed while accessing this activity, I am trying to access current location through google map api in android studio and...
Read more >
Request location updates - Android Developers
Before requesting location updates, your app must connect to location services and make a location request. The lesson on Changing Location Settings shows ......
Read more >
location | Flutter Package - Pub.dev
A Flutter plugin to easily handle realtime location in iOS and Android. ... Fix crash during close of the app; Remove mandatory Android...
Read more >
[Camera Plugin] App crashes after confirming picture
I've been noticing these errors: My phone is a LG G6, Android v8.0. Thanks! You can see, the error in the ...
Read more >
LocationRequest | Google Play services
public long getDurationMillis (). The duration of this request. A location request will not receive any locations after it has expired, and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found