Skip to content

[LocationLayer] crashing issue  #223

Closed

Description

@AndroidDeveloperMCT

I am using locationlayer to show my current location and when I [single/double] tap on map. App getting crashed with following errors.

NOTE :: My GPS is on and i am getting location.

java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayer.calculateZoomLevelRadius(LocationLayer.java:190)
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayer.updateAccuracyRadius(LocationLayer.java:184)
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin.onCameraMove(LocationLayerPlugin.java:483)

Activity

  1. davols commented on Dec 22, 2017

    @davols

    Can confirm this as well. Running com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.3.0-SNAPSHOT

    Stacktrace:

    java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference
        at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayer.calculateZoomLevelRadius(LocationLayer.java:190)
        at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayer.updateAccuracyRadius(LocationLayer.java:184)
        at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin.onCameraMove(LocationLayerPlugin.java:483)
        at com.mapbox.mapboxsdk.maps.CameraChangeDispatcher$2.run(CameraChangeDispatcher.java:62)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5539)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
    

    Edit:
    Pinging @cammace and @tobrun since it seems that it was added in #186 if I'm not mistaken.

  2. cammace commented on Dec 22, 2017

    @cammace

    This was an oversight by me, If the locations null, the accuracy is now set to 0 radii. Fix will be in master once #221 is merged.

  3. added
    bug
    location-layer-plugin
    on Dec 22, 2017
  4. self-assigned this
    on Dec 22, 2017
  5. added this to the location-layer-0.3.0 milestone on Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buglocation-layer-plugin

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions