You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
I believe the trouble started when we added a second MapView in our main activity.
Our main activity has a ViewPager that holds several Fragments that you can switch between. We used to only use a MapView in one of the fragments, but we added a MapView to another one of the fragments.
When I first implemented it, I had this build configuration:
I had app crashes as soon as the second MapView was added. I realized something very strange: If I deleted all app data from the phone and ran it once, everything worked correctly for that run. When I quit or killed the app and launched it again, it would crash. Once in this state, it crashed every single time I launched the app. The only remedy was to delete app data, which would only allow it to work once. Then it would get back into that constant-crash state.
I think there was a log message related to going out of bounds on a native buffer. I'm sorry but it was a while ago and I can't remember exactly.
I updated our Mapbox dependencies to the following versions:
After dealing with all the Style-related API changes, this appeared to fix it. I could not repro that issue on my phone and the maps always displayed properly on my various test phones.
That build was released a while ago and we are unfortunately getting a lot of reports from users that their maps are blank or gray. See attached screenshot. Since these are not crashes, I don't have any crash reports or any further information. It seems like the people this happens to have it happen consistently.
I have a Samsung Galaxy S9+ and it works fine for me. A friend has the newer S10+ and he has had the blank map issue. The interesting thing is both of those maps in the main activity work fine for him. There's another activity that is launched to show a specific ride, which uses a MapView in a fragment. That one is I think always gray for him. At least every time he showed me. Again, it works fine on my test phones (my S9+, Nexus 6P, an old crappy phone I don't have on me today that runs Android 5).
After going through your MapFragment code and my two fragments used in my main activity, I only noticed only one difference: You guys call mapview.onCreate() from the fragment's onViewCreated(). I was calling it in onCreateView(). So I switched.
I moved my calls to mapview.getMapAsync() and mapboxMap.setStyle() along with it, so they happen after mapview.onCreate() is invoked.
mapView.getMapAsync(mapboxMap -> {
mapboxMap.setStyle(new Style.Builder().fromUrl(MAPBOX_DEF_STYLE_URL), style -> {
this.mapboxMap = mapboxMap;
// I don't use the map until the style is done...
}
}
Now I get the same issue where the first app run works (after app data is deleted) and then subsequent app runs have problems. Instead of immediate crashes I have logs now.
This is spewed constantly:
2019-04-11 11:56:23.592 10029-11032/com.reverllc.rever E/Mbgl-MapRenderer: unknown pbf field type exception
Same result. Those log messages are actually from this version.
So... not really sure what to try at this point. Our app version out there at least works for most people, but we have paying customers who have blank maps and aren't too happy about it.
Steps to reproduce
Guessing at the cause:
Create an activity with a ViewPager holding multiple fragments.
Use MapViews in more than one of these fragments.
Run your app, see your maps.
Quit/kill your app.
Run your app again.
Boom.
Expected behavior
Don't crash. Show actual maps instead of gray/blank maps.
Any update on this? This is super high priority for us, causing lots of problems with our users.
I don't know if it helps, but something I noticed:
-As I said above, if you wipe the app data and fire it up, the map seems to always show up for that first fresh run.
-On my phone I noticed that if on that first fresh boot I use the map for "a while", then it gets into a state where it continues to work on subsequent app startups. Not sure why.
-Conversely, if on that first fresh boot I quit the app quickly after seeing the map, it always puts me into the bad state where the map will never work again.
unknown pbf field type exception is ticketed out in #14294 and is worked around for now with #14298. This fix is available in v7.3.2 and can be paired against v0.36.0 of navigation.
I believe the trouble started when we added a second MapView in our main activity.
Our main activity has a ViewPager that holds several Fragments that you can switch between. We used to only use a MapView in one of the fragments, but we added a MapView to another one of the fragments.
When I first implemented it, I had this build configuration:
I had app crashes as soon as the second MapView was added. I realized something very strange: If I deleted all app data from the phone and ran it once, everything worked correctly for that run. When I quit or killed the app and launched it again, it would crash. Once in this state, it crashed every single time I launched the app. The only remedy was to delete app data, which would only allow it to work once. Then it would get back into that constant-crash state.
I think there was a log message related to going out of bounds on a native buffer. I'm sorry but it was a while ago and I can't remember exactly.
I updated our Mapbox dependencies to the following versions:
After dealing with all the Style-related API changes, this appeared to fix it. I could not repro that issue on my phone and the maps always displayed properly on my various test phones.
That build was released a while ago and we are unfortunately getting a lot of reports from users that their maps are blank or gray. See attached screenshot. Since these are not crashes, I don't have any crash reports or any further information. It seems like the people this happens to have it happen consistently.
I have a Samsung Galaxy S9+ and it works fine for me. A friend has the newer S10+ and he has had the blank map issue. The interesting thing is both of those maps in the main activity work fine for him. There's another activity that is launched to show a specific ride, which uses a MapView in a fragment. That one is I think always gray for him. At least every time he showed me. Again, it works fine on my test phones (my S9+, Nexus 6P, an old crappy phone I don't have on me today that runs Android 5).
After pouring through your issue trackers, I saw reference to your MapFragement class:
https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java
After going through your MapFragment code and my two fragments used in my main activity, I only noticed only one difference: You guys call mapview.onCreate() from the fragment's onViewCreated(). I was calling it in onCreateView(). So I switched.
I moved my calls to mapview.getMapAsync() and mapboxMap.setStyle() along with it, so they happen after mapview.onCreate() is invoked.
Now I get the same issue where the first app run works (after app data is deleted) and then subsequent app runs have problems. Instead of immediate crashes I have logs now.
This is spewed constantly:
2019-04-11 11:56:23.592 10029-11032/com.reverllc.rever E/Mbgl-MapRenderer: unknown pbf field type exception
Eventually it gets a JNI weak reference crash.
The crash:
I tried updating to the following:
Same result. Those log messages are actually from this version.
So... not really sure what to try at this point. Our app version out there at least works for most people, but we have paying customers who have blank maps and aren't too happy about it.
Steps to reproduce
Guessing at the cause:
Expected behavior
Don't crash. Show actual maps instead of gray/blank maps.
Actual behavior
Crashes and/or gray/blank maps.
Configuration
Build config shown above.
Android versions:
Device models:
Mapbox SDK versions:
The text was updated successfully, but these errors were encountered: