-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Crash onPreDraw: EGL_BAD_DISPLAY #7738
Comments
Sorry for the noise. The error message was misleading. In case others have a similar issue, change your activity like this: public class NewMapActivity extends AppCompatActivity {
MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_map);
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
MapboxAccountManager.start(this, "your-api-key");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
mapView.onSaveInstanceState(outState);
}
@Override
public void onResume() {
super.onResume();
mapView.onResume();
}
@Override
public void onPause() {
super.onPause();
mapView.onPause();
}
@Override
public void onLowMemory() {
super.onLowMemory();
mapView.onLowMemory();
}
@Override
protected void onDestroy() {
super.onDestroy();
mapView.onDestroy();
}
} |
Hi @grote I'd like to re-open this issue. I have the same problem after rewriting MapBox support for Mapillary. My investigation leads me to believe that the problem is with the async use of SurfaceHolder.Callback
Consider what will happen if there is a delay before implementations call mapView.onCreate(bundle) from the Activity. I think two possible solutions to this problem could be: Best regards |
While the above problem can be worked around by making sure that MapView.onCreate() is called directly after Activity.setContentView() there is another identical crash when I use the MapView within a custom ViewGroup (layout) with TextureView components. In the camera activity I display the camera preview, using custom layout, on an implementation of TextureView. Could it perhaps be a similar problem with nativeMapView but related to resizing of the underlying surface? |
@zugaldia has access to the Mapillary android source and could maybe help us track this down? It's a blocker for us right now. |
@rsahlin Are you observing the issue in any specific devices or OS versions? @peterneubauer I'll follow up too on the Mapillary repo. |
Hi @zugaldia This is on the 4.2.1 branch, tested on Android 6.01 I've tried to build, in order to try to fix the problem, but I am lacking an .aar with all mapbox classes kept. If you have access to the Mapillary repo, please clone the bugfix/nestedcameralayout branch. Best regards |
There is a build error that was introduced when trying to build towards your master branch.
Please make sure this is present. |
@rsahlin I see that you're managing instantiation and lifecycle for |
@zugaldia That class should not be there, could you please make sure you are looking at the latest commit?
If you look in CameraActivity I handle the lifecycle of MapView according to documentation and camera.xml is used as content view (it uses com.mapbox.mapboxsdk.maps.MapView) |
cc: @tobrun for extra 👀 . |
Thanks for the feedback. I've been able to look at the branch and reproduce the issue. Since For now, a workaround is to switch to
Longer term, we're working on moving to a |
Hi @tobrun and thanks for the swift reply! Great, I'll update to 4.2.2 tomorrow and test with the specified parameter. Best regards |
Hi @tobrun I have now checked using 4.2.2 and mapbox:texture_mode="true" in the XML. Please let me know if there is anything I can do to help you. /Richard |
This issue looks very similar to #4385 and #2995, but it still happens with
com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.1
on Android 5.So essentially the app crashes when trying to draw the map. Here's the stacktrace:
This is how the layout is defined:
And this is how the activity looks like:
Please let me know if you need additional information.
The text was updated successfully, but these errors were encountered: