-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Android] Mapzen crash - NullPointerException #8999
Comments
For me the same at 5.1.0-beta2. I also get the java.lang.NullPointerException at This also appears when I use |
Thank you, it looks like an issue with the latest version of LOST. We've reported it to lostzen/lost#198. |
Thanks for creating an issue! We have merged a fix for this. Please refresh your dependencies and rebuild. |
Thanks for working on this issue. At which dependency do you merged this fix? |
I tried the fix and it works. But only when i have |
same here, I get the crash when |
THE LATEST SNAPSHOT IS WORKING FOR ME WITH LOCATION ENABLED. REJOICE! HALLELUJAH! THANK YOU! |
@mrfaa @pamartineza I am unable to reproduce what you are seeing. I've pushed my sample code to this branch for reference. Could you provide me with more information? Exactly which calls are you making to the Mapbox sdk and in what order? If there is any sample or pseudo code you can provide, that would also be helpful. Thank you. @Emeritus-DarranKelinske Great, thanks for testing! |
@sarahlensing thank for following up. I'm including mapbox in my project like mentioned in https://www.mapbox.com/android-sdk/ with all the lifecycle methods. When the map is ready (onMapReady) I'm requesting the following methods on my mapbox map: |
@mrfaa @pamartineza I'm unable to reproduce it as well - are you sure you cleared your dependencies and use newest SNAPSHOT build? @sarahkleins @tobrun I've tried to disable Location in |
@mpuchala I have just cleared my dependencies and today with the SNAPSHOT build the crash is gone. :) |
Hey @mpuchala
Thank you for reaching out and reporting your problem. |
Capturing from above that this issue is resolved, thank you all for helping out! |
@mpuchala i use the newest SNAPSHOT I'm using Android 7.0 with targetSdkVersion 25, compileSdkVersion 25 and buildToolsVersion 25.0.2 |
I have this same issue when setting to false.
…On May 22, 2017 12:18 PM, "Fabian" ***@***.***> wrote:
@mpuchala <https://github.com/mpuchala> i use the newest SNAPSHOT
***@***.*** and refreshed
all my dependencies. It works works everything fine. But when i set
mapboxMap.setMyLocationEnabled(false) it crashes with the NPE at
lost.api.LocationAvailability. However i will use mapbox only with
setMyLocationEnabled to true, so its not a problem for me.
I'm using Android 7.0 with targetSdkVersion 25, compileSdkVersion 25 and
buildToolsVersion 25.0.2
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8999 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AP9KIvoSvXtceGZLVSL7x4r_Ktb3v5zBks5r8cMbgaJpZM4Na6a5>
.
|
Thank you to everyone working on this project! <3 |
@tobrun Where in the Mapbox SDK are location updates removed? I see
We introduced a change with this PR which simplifies what happens when a client disconnects. Before this PR, location updates would be removed on disconnect, but after, they no longer are. So, if you aren't removing location updates, it would make sense that you see this crash. Hope this helps, let me know what you find! |
Thank you for 👀 @sarahlensing, you are correct, this is fixed with #9099 and resolves #9068. Note that I haven't been able to produce the null pointer mentioned by others. Would love if someone above with the crash could verify if #9099 resolves this issue as well or provide some additional context. Thanks again to all for helping out! |
@tobrun Good job, I havent notice above bug, but right now app crashes from different reason. This happen really often on Samsung Note 3 (Android 5.1.1):
|
@krsticdragan Thank you for reaching out and reporting your problem. As @sarahlensing pointed out:
It's detailed in the Upgrade Notes section of Lost 3.0.0 release notes:
You're getting the exception defined here. |
@Guardiola31337 Thanks, I unregister it and manage to fix it up 👍 |
@krsticdragan I also get the crash at I'm using the newest |
@mrfaa did you try above comment? |
@Guardiola31337 Thanks, you are right. I saw that @tobrun noted that this is fixed in #9099 and will be available in Release Android v5.1.0-beta.3 #9114 :-) |
@mrfaa You will need to remove LocationEngineListener manually. I did it by using removeLocationEngineListener(locationEngineListener) in onDestroy() method, it should fix the issue. |
@krsticdragan @mrfaa what components are you using to get Location data? If you are solely relying on |
@tobrun I only use I have implemented my own "FusedLocationProviderService" by using the Google FusedLocationProviderApi, where i handle the user location for other purposes in my app. |
@tobrun I tought that was the issue with setMyLocationEnabled method. Currently Im using LocationManager and only setMyLocationEnabled(true). Testing out the application right now with the LocationEngineListener and it seems to occur when switching from one map back to the previous one in two different activities even I created and remove LocationEngineListener. |
@mrfaa I had the same problem. And in my project I do not need to use map box positioning and LOSTApi (i use Google api for positioning). Now I have changed mapbox shared preferences and fix this problem. TelemetryUtils.getSharedPreferences(mainActivity).edit().putBoolean(TelemetryConstants.MAPBOX_SHARED_PREFERENCE_KEY_TELEMETRY_ENABLED, false).apply(); |
@giperwlad Are you using setMyLocationEnabled method? I tried your solution and unfortunatly that didnt fix it. |
@krsticdragan . I don't call setMyLocationEnabled method. I I do not need to use map box positioning. Try to change shared preferences before calling Mapbox.getInstance() method |
@tobrun Is it a problem when I implemented my own FusedLocationProvider in my project? Do I have to handle mapbox specific? My thought is, that the issue Thanks for following up! |
@giperwlad Thanks for a hint, but that didnt work, just manage to reproduce a bug. @mrfaa I switched to 5.1.0-beta.3 and bug is still there. |
Still getting it on
The issue is that sometimes an activity / app doesn't close gracefully and the next time it starts back up the app crashes with this: 05-31 11:03:24.592 8741-8741/com.laelaps.collar.ui E/AndroidRuntime: FATAL EXCEPTION: main When you open it the next time, this exception does not happen. |
Been debugging this today myself and also hit the exception that @Emeritus-DarranKelinske has by rotating the device 10-20 times. I'm looking into this more if this is something that needs to be fixed from our end or LOST. |
I can confirm, that I'm getting this crash with 5.1.0-beta.3 and mapbox-android-services:2.1.1@aar. Due specific business needs I'm trying not to use (actually I'm not using) mapbox provided tracking mode and instead I'm using google maps LocationServices.FusedLocationApi by myself. |
I'm going to close this issue, so we have more clarity on the milestone related to the LOST issue. I'm opting to track this in #9139 as we have a PR tackling that in #9142. In this PR we working on resolving the current outstanding upstream issues (lostzen/lost#213). Thank you all for chipping in, continuing this issue in #9139. |
@tobrun Sir,how can i disable the mapbox in onpause and ondistroy method ?? |
Platform: Android 7.0
Mapbox SDK version: 5.1.0-beta2
Steps to trigger behavior
My Location
enabledActual behavior
When using 5.1.0-beta.2 there is a crash on close. Even when I create example project and set:
After I close app I get a NullPointerException related to mapzen.
I haven't noticed it before (stable 5.0.2) now it's very common - sometimes it takes few seconds to get it. I'm not able to reproduce it when
MyLocation
is disabled.If it's duplicated or known issue feel free to close, but I guess it's another blocker for stable 5.1.0 version.
The text was updated successfully, but these errors were encountered: