-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Crash on Android GL init #1435
Comments
Got more detail from debug build:
It appears |
This is likely because Android starts the map paused, which causes the |
Does it need to do this? If not, it would be great to remove the |
@jfirebaugh The reason I added starting the map paused is that Android hands over a valid GL context some time after creating the Java MapView class and constructing the corresponding native map object. Thus there needs to be a way to create the map and start handling property changes (e.g. an app's initialisation code sets the center coordinate) without triggering GL commands straight away. |
@ljbade Current status of Things that are safe:
Things that will deadlock:
I think we should probably change how pause is implemented so that |
@ljbade Can we just wait until the Android equivalent of EAGLContext is ready before calling Map::start? |
@mb12 |
@jfirebaugh thanks for the list of things that deadlock. I fixed the above crash only to get it hang somewhere so I suspect one of those functions is doing it. I will have a close look at what gets called. |
Made good progress today thanks to @jfirebaugh. Turns out their was a flaw in the implemnetation of However the map hangs after backgrounding and restoring the app. So more work to do before I can merge the fixes. |
This is the log after backgrounding:
Seems the main thread is blocked because there is no printout for resuming. |
Hmm it looks like calling @jfirebaugh Is this a flaw in |
I just tried running the latest fixes on the 1435-android-gl-crash branch and got the TestApp to run on my Samsung S5. However, no map tiles rendered (no matter which style selected). It's a bit unclear as to whether they should or not at this stage based on the comments above in this ticket. It looks like the Thoughts? |
@ljbade I think it would be fine to add a |
@jfirebaugh OK great idea. @bleege See #1468 for the second problem. I found this a while ago, and I think @kkaefer had noticed it too. |
@ljbade Interesting. Glad it's consistent. ;-) Can you confirm that Android is using the same rendering API that iOS is using these days? This would be really cool to see how all the work on Core GL shows on Android these days. |
Initialise NativeMapView's EGL variables before Map Fix hang Add check for double pause
Initialise NativeMapView's EGL variables before Map Fix hang Add check for double pause Add test for double pause
Initialise NativeMapView's EGL variables before Map Fix hang Add check for double pause Add test for double pause
Initialise NativeMapView's EGL variables before Map Fix hang Add check for double pause Add test for double pause
Initialise NativeMapView's EGL variables before Map Fix hang Add check for double pause Add test for double pause
Hi @ljbade , My app gets closed and opens from home page with the following error:
Can you please tell how to resolve this problem? |
@dharma237 Can you tell us more about the app and the device that this issue is appearing on? Specifically what version of the Mapbox Android SDK is being used and what device and version of Android is this appearing on? |
@bleege crash is not specific to some device. crash reproduces for pre lollipop and after lollipop devices. I am initializing mapview like below:
|
@dharma237 Are all the lifecyle methods implemented as described in https://www.mapbox.com/android-sdk/examples/ ? |
@bleege Yes. I am implementing same as described in https://www.mapbox.com/android-sdk/examples/ . |
Ahh... the app is using a Fragment to contain the MapView. The SDK has a MapFragment class for this purpose. Please see the MapFragmentActivity in the TestApp for an example of how to make this work. |
@bleege There are hundreds of fragments which uses mapviews in my project. So for better navigations I am using fragments and faces the problem if I changes them all intohttps://github.com/mapbox/mapbox-gl-native/blob/29d61c0fe72ba96d0f60db1cd2bff2834c7c7657/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/MapFragmentActivity.java. |
This is handled automatically by the |
so the answer for the above crash? I am still reproducing that one. |
It's hard to say without knowing more about the code and application. Is it possible to share the source on GitHub or a working subset app using this same setup? |
Can you give me the personal skype id... I can show you in skype... |
@dharma237 For direct support the best route would be to contact Mapbox Technical Support via their Web form --> https://www.mapbox.com/contact/ |
(Mapbox does not offer phone/skype support.) |
Hi Bleege, I am using below Mapbox library for showing maps in my android application. Thank you. |
@AnithaGorli Thanks for using our SDK. If you have a bug to report, please open a new issue and include as much information as you have available — especially crash logs and reproduction steps. |
I am seeing this crash:
The text was updated successfully, but these errors were encountered: