Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

_getLocationCallback() from plugin crashes the app #264

@deindesignpl

Description

@deindesignpl

Hi, firstly thanks for great plugin. In works well, but what I noticed is that sometimes _getLocationCallback() crashes NativeScript App.

The error I get is:

NativeScriptException
Calling js method onLocationResult failed
TypeError: Cannot read property 'forEach' of undefined

Here is the stack trace that I managed to log:

com.tns.Runtime in callJSMethodNative
com.tns.Runtime in dispatchCallJSMethodNative at line 1209
com.tns.Runtime in callJSMethodImpl at line 1096
com.tns.Runtime in callJSMethod at line 1083
com.tns.Runtime in callJSMethod at line 1063
com.tns.Runtime in callJSMethod at line 1055
com.tns.gen.com.google.android.gms.location.LocationCallback_vendor_1_498322_ in onLocationResult at line 19
com.google.android.gms.internal.location.zzau in notifyListener at line 4
com.google.android.gms.common.api.internal.ListenerHolder in notifyListenerInternal at line 17
com.google.android.gms.common.api.internal.ListenerHolder$zaa in handleMessage at line 5
android.os.Handler in dispatchMessage at line 106
com.google.android.gms.internal.base.zap in dispatchMessage at line 8
android.os.Looper in loop at line 171
android.app.ActivityThread in main at line 6637
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 518
com.android.internal.os.ZygoteInit in main at line 824

After debugging I found out that it might be something with onLocationResults and getLastLocation() call in:

onLocationResult: function (locationResult) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions