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

Android 4.0.2-beta1 demos crashes at startup on Genymotion #5939

Closed
dagatsoin opened this issue Aug 11, 2016 · 12 comments
Closed

Android 4.0.2-beta1 demos crashes at startup on Genymotion #5939

dagatsoin opened this issue Aug 11, 2016 · 12 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@dagatsoin
Copy link

dagatsoin commented Aug 11, 2016

Platform: Android
Mapbox SDK version: 4.2.0-beta1

Steps to trigger behavior

  1. Create an empty Android Studio project
  2. Create a default activity with a layout from mapbox examples
  3. Run on Genymotion Google Nexus 10 - 4.4.4 - API 19

Actual behavior

The demo works on Genymotion Emulator with API 23
The demo crashes on Genymotion Emulator with API 19
I haven't test case between 19-23.

Process: com.example.vikti.mapboxandroidsdk, PID: 13960
java.lang.Error: eglChooseConfig() failed
at com.mapbox.mapboxsdk.maps.NativeMapView.nativeInitializeDisplay(Native Method)
at com.mapbox.mapboxsdk.maps.NativeMapView.initializeDisplay(NativeMapView.java:105)
at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:441)
at com.mapbox.mapboxsdk.maps.SupportMapFragment.onViewCreated(SupportMapFragment.java:139)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1123)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5241)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
08
@dagatsoin dagatsoin changed the title Android 4.0.2-beta1 Fragment demo crashes at startup. Android 4.0.2-beta1 demos crashes at startup on Genymotion Aug 11, 2016
@dagatsoin
Copy link
Author

Similar to #5939? /cc @dapetcu21 @vfaSonnt @jabm111

@jfirebaugh jfirebaugh added the Android Mapbox Maps SDK for Android label Sep 21, 2016
@cammace
Copy link
Contributor

cammace commented Sep 26, 2016

Tested using the latest Genymotion version and Mapbox Android SDK 4.2.0-beta.3 and was able to reproduce on API 19 (seems to be any device). API 21 and above the map loads in fine with no immediate issues.

@mmBs
Copy link

mmBs commented Oct 4, 2016

The same happens on Genymotion Samsung Galaxy S3 - 4.1.1 - API16 and the same mapbox-android-sdk:4.2.0-beta.3.

@eddieux
Copy link

eddieux commented Oct 18, 2016

I tried to debug this and saw an "java.lang.reflect.InvocationTargetException" with cause: "java.lang.Error:eglChooseConfig() failed" in NativeMapView.nativeInitializeDisplay() method (and my debugging skills stops there). Does this ring a bell with anybody? API 19, 4.2.0.beta.3.

@zugaldia
Copy link
Member

Interestingly, I'm getting a similar crash when I try to running 4.2.0 with the preview of Android Things (on a Raspberry Pi).

I'm attaching the full log below, note how the SDK erroneously identify this new platform as an "emulator":

Client not ready yet..Connected to process 1389 on device unknown-iot_rpi3-10.0.1.3:5555
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/MapboxEventManager: Telemetry initialize() called...
I/MapboxEventManager: Right before Telemetry set enabled in initialized()
I/MapboxEventManager: setTelemetryEnabled(); this.telemetryEnabled = false; telemetryEnabled = true
D/MapboxEventManager: Starting Telemetry Up!
W/LocationServices: Location Permissions Not Granted Yet.  Try again after requesting.
I/MapboxEventManager: Permissions are not good.  Need to do some looping to check on stuff.
E/MapboxEventManager: Error Trying to load Staging Credentials: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.BaseBundle.getString(java.lang.String)' on a null object reference
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/art: Thread[1,tid=1389,Native,Thread*=0xb0605400,peer=0x739ef950,"main"] recursive attempt to load library "/data/app/com.mapbox.iotmap-1/lib/arm/libmapbox-gl.so"
I/art: Thread[1,tid=1389,Native,Thread*=0xb0605400,peer=0x739ef950,"main"] recursive attempt to load library "/data/app/com.mapbox.iotmap-1/lib/arm/libmapbox-gl.so"
I/art: Thread[1,tid=1389,Native,Thread*=0xb0605400,peer=0x739ef950,"main"] recursive attempt to load library "/data/app/com.mapbox.iotmap-1/lib/arm/libmapbox-gl.so"
W/LocationServices: Location Permissions Not Granted Yet.  Try again after requesting.
W/LocationServices: Location Permissions Not Granted Yet.  Try again after requesting.
E/OfflineManager: Failed to read the storage key: Attempt to invoke virtual method 'boolean android.os.BaseBundle.getBoolean(java.lang.String, boolean)' on a null object reference
D/mbgl: {m.mapbox.iotmap}[JNI]: nativeCreate
D/mbgl: {m.mapbox.iotmap}[Android]: NativeMapView::NativeMapView
I/mbgl: {DefaultFileSour}[Database]: cannot open file at line 35104 of [29dbef4b85] (Code 14)
I/mbgl: {DefaultFileSour}[Database]: os_unix.c:35104: (2) open(/data/user/0/com.mapbox.iotmap/files/mbgl-offline.db) - No such file or directory (Code 14)
D/mbgl: {m.mapbox.iotmap}[Android]: NativeMapView::enableFps()
E/MapboxMap: Could not activate user location tracking: user did not accept the permission or permissions were not requested.
I/com.mapbox.mapboxsdk.maps.MapView: MapView start Telemetry...
I/MapboxEventManager: Telemetry initialize() called...
I/MapboxEventManager: Mapbox Telemetry has already been initialized.
D/mbgl: {m.mapbox.iotmap}[JNI]: nativeInitializeDisplay
D/mbgl: {m.mapbox.iotmap}[Android]: NativeMapView::initializeDisplay
I/mbgl: {m.mapbox.iotmap}[OpenGL]: EGL Vendor: Android
I/mbgl: {m.mapbox.iotmap}[OpenGL]: EGL Version: 1.4 Android META-EGL
I/mbgl: {m.mapbox.iotmap}[OpenGL]: EGL Client APIs: OpenGL_ES
I/mbgl: {m.mapbox.iotmap}[OpenGL]: EGL Client Extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image_base EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer 
W/mbgl: {m.mapbox.iotmap}[Android]: In emulator! Enabling hacks :-(
E/mbgl: {m.mapbox.iotmap}[OpenGL]: eglChooseConfig() returned no configs.
D/AndroidRuntime: Shutting down VM


                  --------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.mapbox.iotmap, PID: 1389
                  java.lang.Error: eglChooseConfig() failed
                      at com.mapbox.mapboxsdk.maps.NativeMapView.nativeInitializeDisplay(Native Method)
                      at com.mapbox.mapboxsdk.maps.NativeMapView.initializeDisplay(NativeMapView.java:115)
                      at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:468)
                      at com.mapbox.iotmap.MainActivity.onCreate(MainActivity.java:29)
                      at android.app.Activity.performCreate(Activity.java:6662)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
                      at android.app.ActivityThread.-wrap12(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6077)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Application terminated.

This is targeting API 25 with a minimum of API 24. Looking at the release notes I see a graphics-related known issue for the Raspberry Pi: "Hardware graphics acceleration is not currently enabled."

Full code of the app in https://github.com/zugaldia/mapbox-things/tree/master/MapboxIoTMap.

@tobrun
Copy link
Member

tobrun commented Dec 21, 2016

@zugaldia thanks for trying out the SDK on Android things! Could you test if older versions of the SDK work or that you can run any other apps that rely on opengl? What I noticed in the past is that software rendering worked in more cases, but was slower, than hardware accelerated graphics 🤔

Note that the original issue has been resolved with #7044 and the solution was shipped with 4.2.0. Would love to close this issue in favor of opening a new Raspberry Pi specific one.

@snowpong
Copy link

snowpong commented Jan 3, 2017

I notice a similar crash running my own app using Mapbox 4.2.1 on a Genymotion image running API18 (Android 4.3). Same code works fine on a Z2 phone running API23 (Android 6.0). Here is the logcat:

01-03 13:54:58.474 3084-3084/no.dnt.sjekkut D/mbgl: {no.dnt.sjekkut}[JNI]: nativeCreate
01-03 13:54:58.474 3084-3084/no.dnt.sjekkut D/mbgl: {no.dnt.sjekkut}[Android]: NativeMapView::NativeMapView
01-03 13:54:58.486 3084-3084/no.dnt.sjekkut D/mbgl: {no.dnt.sjekkut}[Android]: NativeMapView::enableFps()
01-03 13:54:58.490 3084-3084/no.dnt.sjekkut I/dalvikvm: Could not find method android.widget.RelativeLayout., referenced from method com.hannesdorfmann.mosby.mvp.layout.MvpRelativeLayout.
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut W/dalvikvm: VFY: unable to resolve direct method 21264: Landroid/widget/RelativeLayout;. (Landroid/content/Context;Landroid/util/AttributeSet;II)V
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut D/dalvikvm: VFY: replacing opcode 0x70 at 0x0000
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/com.mapbox.mapboxsdk.maps.MapView: MapView start Telemetry...
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/MapboxEventManager: Telemetry initialize() called...
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/MapboxEventManager: Mapbox Telemetry has already been initialized.
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut D/mbgl: {no.dnt.sjekkut}[JNI]: nativeInitializeDisplay
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut D/mbgl: {no.dnt.sjekkut}[Android]: NativeMapView::initializeDisplay
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/mbgl: {no.dnt.sjekkut}[OpenGL]: EGL Vendor: Android
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/mbgl: {no.dnt.sjekkut}[OpenGL]: EGL Version: 1.4 Android META-EGL
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/mbgl: {no.dnt.sjekkut}[OpenGL]: EGL Client APIs: OpenGL_ES
01-03 13:54:58.494 3084-3084/no.dnt.sjekkut I/mbgl: {no.dnt.sjekkut}[OpenGL]: EGL Client Extensions: EGL_KHR_image_base EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
01-03 13:54:58.498 3084-3084/no.dnt.sjekkut E/mbgl: {no.dnt.sjekkut}[OpenGL]: eglChooseConfig() returned no configs.
01-03 13:54:58.498 3084-3084/no.dnt.sjekkut D/AndroidRuntime: Shutting down VM
01-03 13:54:58.498 3084-3084/no.dnt.sjekkut W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xa4c3d648)
01-03 13:54:58.498 3084-3084/no.dnt.sjekkut 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:115)
at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:468)
at no.dnt.sjekkut.ui.PlaceFragment.onCreateView(PlaceFragment.java:228)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2080)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:536)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
01-03 13:55:01.658 3084-3084/? I/Process: Sending signal. PID: 3084 SIG: 9

@tobrun
Copy link
Member

tobrun commented Jan 20, 2017

Older genymotion images pre 5.0.0 seem to not work. The issues shown in original post have been fixed with #7044 and we are able to run back on Genymotion. Closing

@tobrun tobrun closed this as completed Jan 20, 2017
@AntekM
Copy link

AntekM commented Dec 12, 2017

It's still not working with the newest Genymotion and Mapbox - although it works with emulator

Crash on Genymotion:
12-12 11:41:31.185 E/EGLConfigChooser: eglChooseConfig(NULL) returned error 12288
12-12 11:41:31.190 E/AndroidRuntime: FATAL EXCEPTION: GLThread 198
Process: com.rh.tudoo, PID: 2595
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)
12-12 11:41:32.733 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe12c3650

@zugaldia
Copy link
Member

Wondering if we need a similar check for Genymotion.

@AntekM
Copy link

AntekM commented Dec 12, 2017

It would be great if it was possible to use MapBox with Genymotion. While it's true that emulator is now more or less usable, but when it comes for location handling Genymotion is much easier to use (and I believe it's important use case for apps using MapBox ;))

@zugaldia
Copy link
Member

@AntekM could you cut a separate ticket including information about the issue you're now encountering?

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

9 participants