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

Android crashes on startup #2995

Closed
iCyberon opened this issue Nov 10, 2015 · 54 comments · Fixed by #4228
Closed

Android crashes on startup #2995

iCyberon opened this issue Nov 10, 2015 · 54 comments · Fixed by #4228
Assignees
Labels
Android Mapbox Maps SDK for Android crash

Comments

@iCyberon
Copy link

Hey guys,

Looks like mapbox crashes for some devices on start.

14620-14620/am.ggtaxi.main.ggdriver E/libEGL: validate_display:254 error 3008 (EGL_BAD_DISPLAY)
14620-14620/am.ggtaxi.main.ggdriver E/mbgl: {Main}[OpenGL]: eglCreateWindowSurface() returned error 12296
14620-14620/am.ggtaxi.main.ggdriver A/libc: Fatal signal 6 (SIGABRT) at 0x0000391c (code=-6), thread 14620 (i.main.ggdriver)

Device: Samsung Galaxy Tab Pro 8.4 3G/LTE
Android Version: 4.2.2

@iCyberon
Copy link
Author

Some more info:

11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL Vendor: Vivante Corporation
11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL Renderer: Vivante GC1000
11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL Version: OpenGL ES 2.0
11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL SL Version: OpenGL ES GLSL ES 1.00
11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL Extensions: GL_EXT_debug_marker GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_EGL_image GL_OES_depth24 GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_rgb8_rgba8 GL_OES_stencil1 GL_OES_stencil4 GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_depth_texture GL_OES_packed_depth_stencil GL_OES_standard_derivatives GL_OES_get_program_binary GL_EXT_texture_format_BGRA8888 GL_IMG_read_format GL_EXT_blend_minmax GL_EXT_read_format_bgra GL_EXT_multi_draw_arrays GL_APPLE_texture
11-10 19:21:00.328 25781-25781/am.ggtaxi.main.ggdriver I/mbgl: {Main}[OpenGL]: GL Extensions: _format_BGRA8888 GL_APPLE_texture_max_level GL_ARM_rgba8 GL_EXT_frag_depth GL_VIV_shader_binary GL_VIV_direct_texture GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_EXT_multisampled_render_to_texture GL_VIV_clamp_to_border GL_MRVL_texture_video GL_EXT_unpack_subimage GL_OES_element_index_uint GL_OES_mapbuffer GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc
11-10 19:21:01.329 25781-26261/am.ggtaxi.main.ggdriver E/libEGL: eglMakeCurrent:779 error 3002 (EGL_BAD_ACCESS)
11-10 19:21:01.329 25781-26261/am.ggtaxi.main.ggdriver E/mbgl: {Map}[OpenGL]: eglMakeCurrent() returned error 12290
11-10 19:21:01.329 25781-26261/am.ggtaxi.main.ggdriver A/libc: Fatal signal 6 (SIGABRT) at 0x000064b5 (code=-6), thread 26261 (i.main.ggdriver)

@tobrun tobrun added Android Mapbox Maps SDK for Android crash labels Nov 10, 2015
@tobrun tobrun added this to the android-v2.3.0 milestone Nov 10, 2015
@ljbade
Copy link
Contributor

ljbade commented Nov 11, 2015

@iCyberon Can you see if you can find the native stack trace.

In logcat change the "Show only selected application" to "No filter"

In the search box put "DEBUG"
You should see a bunch of lines where the first line is a series of -------

@vkurchatkin
Copy link
Contributor

The same on Samsung Galaxy Tab 3 7.0, Android 4.2.2. This seems to be the origin of the error

if (!eglMakeCurrent(display, surface, surface, context)) {

@bobmeyers5
Copy link

I'm getting the same error 3008 (EGL_BAD_DISPLAY) in eglCreateWindowSurface when creating a MapView on these devices:

  • Kindle Fire HD 3rd Gen running Fire OS 4.5.5 (based on Android 4.4)
  • Visual Studio Android Emulator 7" XHDPI Tablet running Android 4.4 (similar to Asus Google Nexus 7)
  • Visual Studio Android Emulator 7" XHDPI Tablet running Android 5.1.1 (similar to Asus Google Nexus 7)

Totally blocked right now... :(

@iCyberon
Copy link
Author

I think this only happens on tablets.

@bobmeyers5
Copy link

Attaching some relevant debug log info from the Kindle Fire HD after enabling OpenGL traces (logcat) in Developer Options.

From Xamarin Studio debugger's Application Output window:
mapbox-opengl-error-log.txt

Logcat details from DDMS:
mapbox-opengl-error-stack-trace.txt

@bobmeyers5
Copy link

@iCyberon, possible -- all my previous tests above were tablets. However, I just tried it on VS Android Emulator 5.5" XXHPDI Phone running Android 5.1.1 (similar to LG G4) and got the same error.

@iCyberon
Copy link
Author

@bmeyers43 It's related to DPI I guess. http://forum.xda-developers.com/showthread.php?t=2212632

@bobmeyers5
Copy link

Maybe...that bug was happening in eglSwapBuffers, but we're seeing it in eglCreateWindowSurface. Also, the Fire HD reports 216 dpi, while the VS Emulator images both claim to be 323 dpi, so I'm not sure what values/ranges would lead to this error.

@tobrun
Copy link
Member

tobrun commented Nov 19, 2015

on x86 architecture using Genymotion and latest SNAPSHOT, I was able to:

  • run it on + 5.0.0 devices
  • crash on pre 5.0.0 devices

Note: I was able to run on 4.2.2 wiht ARM without a problem

@esisa
Copy link

esisa commented Nov 19, 2015

I am getting the same crash on a Sony Z2(5.1.1) and a Nexus 4(5.1.1).

Never mind, by bad :-)

@bobmeyers5
Copy link

@tobrun, since you are able to repro on at least some devices now, when do you think this will get assigned/fixed?

@tobrun
Copy link
Member

tobrun commented Nov 22, 2015

Looking into this:
Will use android 4.2.2 on x86 (nexus 7 genymotion):

Used following build command:

BUILDTYPE=Debug make android-lib-x86

I'm getting following recurring stacktraces:

http://pastebin.com/6eLwYTHX

Result after symbolicating:

http://pastebin.com/4fqVTXUG

The reference of NativeMapView InitializeDisplay in JNI refers to this

void JNICALL nativeInitializeDisplay(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
    mbgl::Log::Debug(mbgl::Event::JNI, "nativeInitializeDisplay");
    assert(nativeMapViewPtr != 0);
    NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);

    try
    {
        nativeMapView->initializeDisplay();
    } catch(const std::exception& e) {
        throw_jni_error(env, "Unable to initialize GL display.");
    }
}

That will call the underlying code in native_map_view.cpp:

void NativeMapView::initializeDisplay() {
    mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::initializeDisplay");

    assert(display == EGL_NO_DISPLAY);
    assert(config == nullptr);
    assert(format < 0);

    display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    if (display == EGL_NO_DISPLAY) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetDisplay() returned error %d", eglGetError());
        throw new std::runtime_error("eglGetDisplay() failed");
    }

    EGLint major, minor;
    if (!eglInitialize(display, &major, &minor)) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglInitialize() returned error %d", eglGetError());
        throw new std::runtime_error("eglInitialize() failed");
    }
    if ((major <= 1) && (minor < 3)) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "EGL version is too low, need 1.3, got %d.%d", major,
                         minor);
        throw new std::runtime_error("EGL version is too low");
    }

    log_egl_string(display, EGL_VENDOR, "Vendor");
    log_egl_string(display, EGL_VERSION, "Version");
    log_egl_string(display, EGL_CLIENT_APIS, "Client APIs");
    log_egl_string(display, EGL_EXTENSIONS, "Client Extensions");

    // Detect if we are in emulator
    if (inEmulator()) {
        mbgl::Log::Warning(mbgl::Event::Android, "In emulator! Enabling hacks :-(");
    }

    // Get all configs at least RGB 565 with 16 depth and 8 stencil
    EGLint configAttribs[] = {
        EGL_CONFIG_CAVEAT,                               EGL_NONE,           EGL_RENDERABLE_TYPE,
        EGL_OPENGL_ES2_BIT,                              EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
        EGL_BUFFER_SIZE,                                 16,                 EGL_RED_SIZE,
        5,                                               EGL_GREEN_SIZE,     6,
        EGL_BLUE_SIZE,                                   5,                  EGL_DEPTH_SIZE,
        16,                                              EGL_STENCIL_SIZE,   8,
        (inEmulator() ? EGL_NONE : EGL_CONFORMANT),        EGL_OPENGL_ES2_BIT, // Ugly hack
        (inEmulator() ? EGL_NONE : EGL_COLOR_BUFFER_TYPE), EGL_RGB_BUFFER,     // Ugly hack
        EGL_NONE};
    EGLint numConfigs;
    if (!eglChooseConfig(display, configAttribs, nullptr, 0, &numConfigs)) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig(NULL) returned error %d",
                         eglGetError());
        throw new std::runtime_error("eglChooseConfig() failed");
    }
    if (numConfigs < 1) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned no configs.");
        throw new std::runtime_error("eglChooseConfig() failed");
    }

    const auto configs = std::make_unique<EGLConfig[]>(numConfigs);
    if (!eglChooseConfig(display, configAttribs, configs.get(), numConfigs, &numConfigs)) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError());
        throw new std::runtime_error("eglChooseConfig() failed");
    }

    config = chooseConfig(configs.get(), numConfigs);
    if (config == nullptr) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "No config chosen");
        throw new std::runtime_error("No config chosen");
    }

    if (!eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format)) {
        mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib() returned error %d",
                         eglGetError());
        throw new std::runtime_error("eglGetConfigAttrib() failed");
    }
    mbgl::Log::Info(mbgl::Event::OpenGL, "Chosen window format is %d", format);
}

@tobrun
Copy link
Member

tobrun commented Nov 22, 2015

A difference I'm noticing between the working genymotion images versus non-working are the GL version:

Not working logs:

OpenGL ES-CM 1.1 (2.1 INTEL-10.10.18)

Working logs:

OpenGL ES 2.0 (2.1 INTEL-10.10.18)

Also I found this #573 from @ljbade,
it indicates problems related to getting OpenGL ES 2.0 working on emulators.

@tobrun
Copy link
Member

tobrun commented Nov 23, 2015

I'm putting above as a works as designed, the SDK requires a minimum version of OpenGL ES 2.0, we can't enforce this ourselves while running from the IDE but Google Play will filter out devices not having this requirement. The reason why that virtual machine is not able to use the host machine GPU is very strange to me. Need to reach out to Genymotion to get more information.

@tobrun
Copy link
Member

tobrun commented Nov 23, 2015

After investigating my startup crash I'm back at square one.
I will try to approach each mentioned problem above individually:

@iCyberon, @vkurchatkin: Could you add the stack trace @ljbade requested?
Without that trace it will be difficult to investigate the issue.

@bmeyers43: I stumbled on your thread on the Xamarin forums. Since this is not working on any devices for you, I believe something else is going wrong. Is it possible that you are not hooking into the required lifecycle methods as shown here?

Thank you in advance,

@vkurchatkin
Copy link
Contributor

@tobrun
Copy link
Member

tobrun commented Nov 23, 2015

@vkurchatkin

Thank you, this is the result after symbolicating the crash:

********** Crash dump: **********
Build fingerprint: 'samsung/goya3gxx/goya3g:4.2.2/JDQ39/T111XXUAOE1:user/release-keys'
pid: 5147, tid: 5186, name: Map >>> com.mapbox.mapboxgl.testapp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
Stack frame #00 pc 0001ad02 /system/lib/libc.so
Stack frame #1 pc 000180a0 /system/lib/libc.so (abort+4)
Stack frame #2 pc 003e0440 /data/app-lib/com.mapbox.mapboxgl.testapp-7/libmapbox-gl.so
Stack frame #3 pc 003e05b4 /data/app-lib/com.mapbox.mapboxgl.testapp-7/libmapbox-gl.so
Stack frame #4 pc 003d0bc8 /data/app-lib/com.mapbox.mapboxgl.testapp-7/libmapbox-gl.so

fault addr deadbaad on libc.so indicates that there is a problem with a corrupt memory heap.

/cc @zugaldia

@vkurchatkin
Copy link
Contributor

@tobrun but doesn't it happen AFTER eglMakeCurrent returns an error? this seems to be the root of the problem

@tobrun
Copy link
Member

tobrun commented Nov 23, 2015

@vkurchatkin I believe you are right,

eglMakeCurrent is currently returning EGL_BAD_ACCESS

From Romain Guy:
Two possible reasons for this failure:

  • If ctx is current to some other thread, or if either draw or read are bound to contexts in another thread, an EGL_BAD_ACCESS error is generated.
  • If binding ctx would exceed the number of current contexts of that client API type supported by the implementation, an EGL_BAD_ACCESS error is generated.

It could also be that the GPU you are using on tablets does not support shared context.

@vkurchatkin
Copy link
Contributor

It could also be that the GPU you are using on tablets does not support shared context.

does this mean that nothing can be done about it?

@vkurchatkin
Copy link
Contributor

@tobrun ping. (sorry for being annoying)

@tobrun
Copy link
Member

tobrun commented Dec 1, 2015

@vkurchatkin no issue! I really want to get to the bottom of this.
Would you be possible to share the code where you are setting up the MapView?

@vkurchatkin
Copy link
Contributor

@tobrun I can reproduce the issue with MapboxGLAndroidSDKTestApp

@bobmeyers5
Copy link

@tobrun, my fault, you're right -- calling OnCreate() eliminated the EGL_BAD_DISPLAY error in my case. It would be nice if some code inside the Mapbox SDK checked the state initialized by OnCreate before calling eglCreateWindowSurface, and throw a more helpful error if that state has not been initialized yet.

@cesards
Copy link

cesards commented Dec 3, 2015

+1 here!

12-03 01:38:52.931 31950-31950/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 31950 (.gembas.android)
12-03 01:38:52.981 2965-2965/? I/DEBUG: pid: 31950, tid: 31950, name: .gembas.android  >>> com.gembas.android <<<
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #05 pc 00476480  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #06 pc 004765f4  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #07 pc 00466c08  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #08 pc 00465e44  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so (__cxa_throw+240)
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #09 pc 00130490  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so (mbgl::android::NativeMapView::createSurface(ANativeWindow*)+776)
12-03 01:38:53.001 2965-2965/? I/DEBUG:     #10 pc 00136618  /data/app/com.gembas.android-2/lib/arm/libmapbox-gl.so

@bleege bleege removed this from the android-v2.3.0 milestone Dec 4, 2015
@vkurchatkin
Copy link
Contributor

@tobrun Hi! I've managed to run Test App applying the following changes:

diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index d32f3c8..b15997b 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -429,6 +429,12 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
             oldDisplay = display;
         }

+        if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
+            mbgl::Log::Error(mbgl::Event::OpenGL,
+                             "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());
+            throw new std::runtime_error("eglMakeCurrent() failed");
+        }
+
         if (!eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext)) {
             mbgl::Log::Error(mbgl::Event::OpenGL,
                              "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());

I have literally 0 knowledge of OpenGL, so I can't fully explain what's going on, but it seems eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext) wasn't actually releasing context, so subsequent eglMakeCurrent failed on devices that don't support sharing contexts.

I hope this is useful.

@bleege
Copy link
Contributor

bleege commented Feb 25, 2016

/cc @jfirebaugh @kkaefer

@tobrun
Copy link
Member

tobrun commented Mar 7, 2016

@vkurchatkin with that code in place you are able to run on a device that initially gave crashes?

@vkurchatkin
Copy link
Contributor

@tobrun yep, it seems that all features work as expected

@uudruid74
Copy link

Getting the same issue with the plain Mapbox Android SDK

10-25 23:16:35.504 2444-2444/? E/mbgl: [Shader]: Shader failed to compile: ERROR: Valid GLSL but not GLSL ES
10-25 23:16:35.504 2444-2444/? E/mbgl: [Shader]: Vertex shader fill failed to compile: precision highp float;
#ifdef GL_ES
precision highp float;
#else
#define lowp
#define mediump
#define highp
#endif
attribute vec2 a_pos;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * vec4(a_pos, 0, 1);
}
--------- beginning of crash
10-25 23:16:35.506 2444-2444/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadcab1 in tid 2444 (oid.untamedmaps)
10-25 23:16:35.607 1132-1132/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-25 23:16:35.607 1132-1132/? I/DEBUG: Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:5.1.1/LMY48X/2780077:userdebug/test-keys'
10-25 23:16:35.608 1132-1132/? I/DEBUG: Revision: '0'
10-25 23:16:35.608 1132-1132/? I/DEBUG: ABI: 'x86_64'
10-25 23:16:35.608 1132-1132/? I/DEBUG: pid: 2444, tid: 2444, name: oid.untamedmaps >>> systems.eddon.android.untamedmaps <<<
10-25 23:16:35.608 1132-1132/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xdeadcab1
10-25 23:16:35.618 1132-1132/? I/DEBUG: rax 00000000deadcab1 rbx 00007fff34ed3170 rcx 0000000000000000 rdx 00007f9c04605700
10-25 23:16:35.618 1132-1132/? I/DEBUG: rsi 00007fff34ed31b8 rdi 00007f9c05fe4b60
10-25 23:16:35.618 1132-1132/? I/DEBUG: r8 00007fff34ed2f60 r9 00007f9c0621cb01 r10 00007f9c0623acd0 r11 00007f9c05d93000
10-25 23:16:35.618 1132-1132/? I/DEBUG: r12 00007f9c1ba997c0 r13 000000001308c220 r14 00007fff34ed31b8 r15 00007f9c180c7300
10-25 23:16:35.618 1132-1132/? I/DEBUG: cs 0000000000000033 ss 000000000000002b
10-25 23:16:35.618 1132-1132/? I/DEBUG: rip 00007f9c05fe4b6d rbp 00007fff34ed3130 rsp 00007fff34ed3130 eflags 0000000000010206
10-25 23:16:35.618 1132-1132/? I/DEBUG: backtrace:
10-25 23:16:35.618 1132-1132/? I/DEBUG: #00 pc 0000000000251b6d /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so
10-25 23:16:35.618 1132-1132/? I/DEBUG: #1 pc 0000000000251b97 /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so
10-25 23:16:35.618 1132-1132/? I/DEBUG: #2 pc 0000000000251b56 /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so (std::terminate()+22)
10-25 23:16:35.619 1132-1132/? I/DEBUG: #3 pc 00000000002524c4 /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so (std::rethrow_exception(std::exception_ptr)+20)
10-25 23:16:35.619 1132-1132/? I/DEBUG: #4 pc 0000000000105bc9 /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so (jni::ThrowJavaError(_JNIEnv&, std::exception_ptr)+57)
10-25 23:16:35.619 1132-1132/? I/DEBUG: #5 pc 000000000011483f /data/app/systems.eddon.android.untamedmaps-1/lib/x86_64/libmapbox-gl.so
10-25 23:16:35.619 1132-1132/? I/DEBUG: #6 pc 00000000000381f3 /data/data/systems.eddon.android.untamedmaps/cache/slice-com.mapbox.mapboxsdk-mapbox-android-sdk-4.1.1_1a31abfec8c174e9a709d81268f840582d8f19d6-classes.dex

@uudruid74
Copy link

note - happens on all RemixOS, likely all Android_x86

@zugaldia
Copy link
Member

@uudruid74 Thanks for the report. What version of the Mapbox Android SDK, the Android OS, and which devices are you using? Thanks!

@brunoabinader
Copy link
Member

I'm also experiencing Valid GLSL but not GLSL ESwhile configuring my emulator to use Hardware - GLES 2.0 (also referenced in stack overflow: #1 and #2).

Additional information:

  • Mapbox Android SDK from master branch (edf40bb)
    • Tested on both android-lib-x86 and android-lib-x86-64 targets
  • Android Studio 2.2.2 (from Homebrew cask)
  • Android SDK 7.1.1 (Nougat) - API level 25
  • Intel x86 Emulator Accelerator (HAXM installer) 6.0.3

@kkaefer
Copy link
Contributor

kkaefer commented Nov 14, 2016

Same issue in #6400

@uudruid74
Copy link

@zugdalia: Latest RemixOS based on Marshmallow (6.0.1) - identicle OSs, different CPUs (both x86_64) and different graphics drivers. Two are laptops, one an Asus X200CA - Intel/Ivybridge graphics. The other an HP with an AMD A8-4555M (Radeon graphics using Gallium driver). These are both OpenGL 3.0 ES compliant (and below). Also have got the same exact error from the Android Studio emulator on the same HP/AMD system under Antergos/Linux. The SDK is actually spelled out in the dump above in the last line.

It seems to be an issue with the #define lines (compile on demand maybe? llvm?). Looks like there may have been a resolution in Issue #7044

I've not seen if a newer SDK has been released or what.

@tobrun
Copy link
Member

tobrun commented Nov 15, 2016

@uudruid74 the fix from #7044 will fix running on x86. This fix will be included in the following beta5 release of 4.2.0. We are aiming at releasing that today in #7047.

@Max01010101010101
Copy link

mapboxsdk:mapbox-android-sdk Version 5.0.2@aar crashes at startup on Genymotion

04-22 12:26:56.430 2251-2251/com.enp E/mbgl: {com.enp}[OpenGL]: eglChooseConfig() returned no configs.
04-22 12:26:56.774 2251-2251/com.enp E/AndroidRuntime: FATAL EXCEPTION: main
                                                       java.lang.Error: eglChooseConfig() failed
                                                           at com.mapbox.mapboxsdk.maps.NativeMapView.nativeInitializeDisplay(Native Method)
                                                           at com.mapbox.mapboxsdk.maps.NativeMapView.initializeDisplay(NativeMapView.java:127)
                                                           at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:213)
                                                           at com.google.firebase.codelab.friendlychat.mundo.onCreate(mundo.java:155)
                                                           at android.app.Activity.performCreate(Activity.java:5008)
                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
                                                           at android.app.ActivityThread.access$600(ActivityThread.java:130)
                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                                                           at android.os.Handler.dispatchMessage(Handler.java:99)
                                                           at android.os.Looper.loop(Looper.java:137)
                                                           at android.app.ActivityThread.main(ActivityThread.java:4745)
                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                           at java.lang.reflect.Method.invoke(Method.java:511)
                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                           at dalvik.system.NativeStart.main(Native Method)

@tobrun
Copy link
Member

tobrun commented Apr 25, 2017

@Max01010101010101 Do you have more details about the used image?
@Guardiola31337 was able to run on genymotion without an issue.

@zac-mathews
Copy link

Hi @tobrun
I got same error as @Max01010101010101
But I am using com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.2@aar
Gennymotion emulator - Samsung Galaxy S4 - 4.2.2 - API 17

@NancyAndroid
Copy link

Same error if anyone knows the solution than let me know .

@zugaldia
Copy link
Member

zugaldia commented Sep 7, 2017

@NancyAndroid Which version of the SDK are you using? Is this error only occurring within Genymotion?

@Bbunty
Copy link

Bbunty commented Jan 14, 2018

I am getting this in logcat will tring to enter the data to Firebase database?

1-14 17:19:58.570 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:19:58.577 10301-10323/com.example.hp.billingapp V/RenderScript: 0xae976000 Launching thread(s), CPUs 2
01-14 17:19:58.589 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:01.915 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:01.987 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:02.162 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:05.426 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:05.537 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:17.498 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:17.504 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:17.547 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:17.569 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:20.910 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:20.987 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0
01-14 17:20:21.251 10301-10323/com.example.hp.billingapp D/EGL_emulation: eglMakeCurrent: 0xb4332940: ver 2 0

@zugaldia
Copy link
Member

@Bbunty Could you clarify which version of the SDK are you using and if this error is only occurring within Genymotion? is it making your app crash?

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

Successfully merging a pull request may close this issue.