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

iOS: Background crash — "Failed to bind EAGLDrawable" #1243

Closed
friedbunny opened this issue Apr 9, 2015 · 10 comments
Closed

iOS: Background crash — "Failed to bind EAGLDrawable" #1243

friedbunny opened this issue Apr 9, 2015 · 10 comments
Labels
crash iOS Mapbox Maps SDK for iOS

Comments

@friedbunny
Copy link
Contributor

Five or ten minutes after locking my device (iOS 8.3, iPhone 5) but leaving Xcode attached I noticed the demo app had crashed while everything was sitting idle. On master 9b0376e.

2015-04-09 12:40:18.718 Mapbox GL[239:6672] [DEBUG] {0}{Map}[General]: painter setup: 245ms
2015-04-09 12:56:26.258 Mapbox GL[239:6483] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x17699380> to GL_RENDERBUFFER 1
2015-04-09 12:56:26.259 Mapbox GL[239:6483] Failed to make complete framebuffer object 8cd6
Assertion failed: (asyncRender), function triggerRender, file /mapbox-gl-native/src/mbgl/map/map.cpp, line 319.
@incanus incanus added iOS Mapbox Maps SDK for iOS crash labels Apr 10, 2015
1ec5 added a commit that referenced this issue Apr 10, 2015
Throw a static snapshot up for the app switcher. Hope you didn’t plan on moving markers around while the app is in the background.

Fixes #1050, #1186, #1203, #1243.
@1ec5
Copy link
Contributor

1ec5 commented Apr 15, 2015

Fixed in #1254.

@rsimenok
Copy link

Still get this in SDK 3.1.2, in console log

2016-02-25 22:10:27.453 App[19087:4463327] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x81db16f0> to GL_RENDERBUFFER 1
2016-02-25 22:10:27.453 App[19087:4463327] Failed to make complete framebuffer object 8cd6

I doesn't get crash, but i get blank map.
Any ideas how can i fix it? Or why i can get such behaviour?
screen shot 2016-02-25 at 22 13 17

In my app i have viewController with map, from this controller i can push new controller with other map, may be i can have such behaviour because of two map instances at the same time...

@1ec5
Copy link
Contributor

1ec5 commented Feb 25, 2016

@Sh1mor1nka, does the map view have a width or height of 0 points at the time you first add it to the view hierarchy? If so, you’re running into #1572.

@rsimenok
Copy link

@1ec5 Correct, initially i add it without frame.

UPD: Adding frame still doesn't resolve blank map :(
UPD2: Works if I do initWithFrame but if I do [[MGLMapView alloc] init] and after set frame - not working.

@rsimenok
Copy link

A'm not sure but may be it's connected...
I add pin on the map, and setCenterCoordinate right on this pin, and here is result:
screen shot 2016-02-25 at 22 45 55
Blue pin on top of map, not in centre.

@1ec5
Copy link
Contributor

1ec5 commented Feb 25, 2016

You might consider activating Xcode’s view debugger to see if the map view is really the same size you expect it to be. From the screenshot, it looks like the upper part of the map view may be obscured.

@1ec5
Copy link
Contributor

1ec5 commented Feb 25, 2016

Works if I do initWithFrame but if I do [[MGLMapView alloc] init] and after set frame - not working.

That’s correct: if you just call -init, the map view is initialized with a 0×0 frame. In general, you should always provide a frame when initializing a view. Otherwise, any Auto Layout constraints you set up for that view may behave in an unexpected manner.

@rsimenok
Copy link

You might consider activating Xcode’s view debugger to see if the map view is really the same size you expect it to be. From the screenshot, it looks like the upper part of the map view may be obscured.

size is fine

That’s correct: if you just call -init, the map view is initialized with a 0×0 frame. In general, you should always provide a frame when initializing a view. Otherwise, any Auto Layout constraints you set up for that view may behave in an unexpected manner.

But I didn't touch this code and it works in SDK 3.0.0, it centre on pin and map wasn't blank, i just update SDK to the latest version :)

Anyway, thank you very much for your help!

@lukevella
Copy link

I was getting similar warnings in my debug console. For me the problem seemed to be caused by initializing MGLMapView with CGRectZero. I was adding constraints after adding it to my view but this didn't make any difference.

Initializing MGLMapView with a CGRect got rid of the warnings.

@1ec5
Copy link
Contributor

1ec5 commented Mar 10, 2016

@lukevella, yes, this is a known issue: #1572.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants