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

[Android] Mapbox crashes when run on Genymotion #10685

Closed
AntekM opened this issue Dec 12, 2017 · 14 comments
Closed

[Android] Mapbox crashes when run on Genymotion #10685

AntekM opened this issue Dec 12, 2017 · 14 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@AntekM
Copy link

AntekM commented Dec 12, 2017

Mapbox com.mapbox.mapboxsdk:mapbox-android-sdk:5.2.0@aar

Steps:
1). Run the Android app containing map in Genymotion (version 2.11)
2). Crashes:

12-12 12:13:02.275 I/EGLConfigChooser: In emulator: false
                                       
12-12 12:13:02.275  2487: 2570 D/         
                                       HostConnection::get() New Host Connection established 0xd7cee0b0, tid 2570
12-12 12:13:02.328 E/EGLConfigChooser: eglChooseConfig(NULL) returned error 12288
12-12 12:13:02.331 E/AndroidRuntime: FATAL EXCEPTION: GLThread 155
                                     Process: com.xx.yy, PID: 2487
                                     com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigException: eglChooseConfig() failed
                                         at com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser.getNumberOfConfigurations(EGLConfigChooser.java:84)
                                         at com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser.chooseConfig(EGLConfigChooser.java:61)
                                         at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
                                         at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
                                         at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
@tobrun tobrun added the Android Mapbox Maps SDK for Android label Dec 13, 2017
@Tennen
Copy link

Tennen commented Dec 20, 2017

+1

@adelcasse
Copy link

Same here

@wzuo
Copy link

wzuo commented Jan 2, 2018

Same here. Using Nexus 5 6.0.0 API 23 simulator with Genymotion, Play services uninstalled (not sure if the last one changes anything tho)

@lucasgray
Copy link

I am also having this problem,

Running Genymotion on Windows with a Samsung Galaxy S8 7.0.0 API 24, using "@mapbox/react-native-mapbox-gl": "6.0.2",. The interesting thing for me is that this started occurring when I updated to 6.0.2 from 6.0.0.

@wzuo
Copy link

wzuo commented Jan 2, 2018

After looking at Mapbox Android SDK, probably key thing that isEmulator returns false for Genymotion. It has very simple thing to test if emulator is used. This library: https://github.com/framgia/android-emulator-detector/blob/master/library/src/main/java/com/framgia/android/emulator/EmulatorDetector.java uses more complex method to detect this, and Genymotion is detected from Build.MANUFACTURER. Unfortunately I can't set-up my PC to build this SDK and test if this is really the issue.

@wzuo
Copy link

wzuo commented Jan 2, 2018

Confirming that 6.0.0 works perfectly fine, whereas 6.0.2 doesn't.

@nitaliano
Copy link
Contributor

For reference between versions

RN Mapbox SDK Version Android Mapbox SDK Version
6.0.0 5.1.4
6.0.2 5.2.1

@TranThuong
Copy link

+1, we can't launch our application on Genymotion anymore from version 5.2

@TranThuong
Copy link

TranThuong commented Jan 4, 2018

We look at the https://github.com/framgia/android-emulator-detector/blob/master/library/src/main/java/com/framgia/android/emulator/EmulatorDetector.java proposed by @wzuo, we make a small modif like below in the "EGLConfigChooser.java" class, that helps us temporally overcome the issue:

private boolean inEmulator() {
return System.getProperty("ro.kernel.qemu") != null || isGenymotionEmulator()|| buildModelContainsEmulatorHints();
}

private boolean isGenymotionEmulator() {
String buildManufacturer = Build.MANUFACTURER;
return buildManufacturer != null &&
(buildManufacturer.contains("Genymotion") || buildManufacturer.equals("unknown"));
}

private boolean buildModelContainsEmulatorHints() {
String buildModel = Build.MODEL;
return buildModel.startsWith("sdk")
|| "google_sdk".equals(buildModel)
|| buildModel.contains("Emulator")
|| buildModel.contains("Android SDK");
}

@tobrun
Copy link
Member

tobrun commented Jan 4, 2018

@TranThuong thank you for adding that code block. Will look into patching up in our GlSurfaceView config chooser. Adding to the 6.0.0 milestone.

@tobrun tobrun added this to the android-v6.0.0 milestone Jan 4, 2018
@wzuo
Copy link

wzuo commented Jan 4, 2018

@TranThuong can you sent me built android lib? I can't manage to compile it, for some reason gradle doesn't detect NDK, even if it's present. And I'm stuck now with application, since 6.0.0 has scrolling bug, and 6.0.2 is not working on emulator. That's how I'm building:
./gradlew clean assembleRelease -Pmapbox.abis=armeabiv7 -Pndk.dir="path_to_ndk/" --debug --stacktrace

@tobrun tobrun modified the milestones: android-v6.0.0, android-v5.3.1 Jan 5, 2018
@tobrun
Copy link
Member

tobrun commented Jan 5, 2018

Was able to fix it up by adding detection for Genymotion:

screen shot 2018-01-05 at 13 42 52

Will land as part of the 5.3.1 release, aimed at next week.
Thank you all for reaching out!

@jonathantobi
Copy link

Hi @tobrun , I still seem to have this problem with the 6.1.3 MapBox Android SDK. I'm using a Google Nexus 4 - 5.0.0 Emulator with Genymotion.
This is the exception I get when trying to run Mapbox app in Genymotion Emulator

E/AndroidRuntime: FATAL EXCEPTION: GLThread 187 Process: ego.sandbox.com.mapbox, PID: 3592 com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigException: eglChooseConfig() failed at com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser.getNumberOfConfigurations(EGLConfigChooser.java:96) at com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser.chooseConfig(EGLConfigChooser.java:73) at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1023) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1400) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)

@fdermishin-radargeo
Copy link

I also received a similar crash report in Crashlytics with MapBox version 6.1.3. I don't know if it was run in emulator or not. The reported device is rooted Galaxy Trend2 running Android 4.4.2

com.mapbox.mapboxsdk.maps.renderer.egl.EGLConfigChooser.chooseConfig (EGLConfigChooser.java:76)
android.opengl.GLSurfaceView$EglHelper.start (GLSurfaceView.java:1029)
android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1406)
android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1245)

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

No branches or pull requests

10 participants