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

[Android] Fatal Exception: java.lang.Error: eglSwapInterval() failed #6112

Closed
DmitryTankovich opened this issue Aug 22, 2016 · 14 comments
Closed
Labels
Android Mapbox Maps SDK for Android crash

Comments

@DmitryTankovich
Copy link

DmitryTankovich commented Aug 22, 2016

java.lang.Error: eglSwapInterval() failed
com.mapbox.mapboxsdk.maps.NativeMapView.nativeCreateSurface(Native Method)
com.mapbox.mapboxsdk.maps.NativeMapView.createSurface(NativeMapView.java:121)
com.mapbox.mapboxsdk.maps.MapView$SurfaceCallback.surfaceCreated(MapView.java:1410)
android.view.SurfaceView.updateWindow(SurfaceView.java:539)
android.view.SurfaceView.access$000(SurfaceView.java:85)
android.view.SurfaceView$3.onPreDraw(SurfaceView.java:173)
android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1617)
android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4448)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
dalvik.system.NativeStart.main(Native Method)
@DmitryTankovich DmitryTankovich changed the title Fatal Exception: java.lang.Error: eglSwapInterval() failed [Android] Fatal Exception: java.lang.Error: eglSwapInterval() failed Aug 22, 2016
@tobrun
Copy link
Member

tobrun commented Aug 24, 2016

@DmitryTankovich got a bit more information on this issue? OS version? Device? Mapbox SDK version? Use-case to reproduce? Thanks you for reaching out!

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Aug 24, 2016
@DmitryTankovich
Copy link
Author

@tobrun Sorry
Version 4.0.4
Device Sony MT25i
Mapbox 4.2.0-beta.1

@whitecloud-sas
Copy link

whitecloud-sas commented Aug 24, 2016

same error

java.lang.Error: eglSwapInterval() failed
    at com.mapbox.mapboxsdk.maps.NativeMapView.nativeCreateSurface(Native Method)
    at com.mapbox.mapboxsdk.maps.NativeMapView.createSurface(NativeMapView.java:116)
    at com.mapbox.mapboxsdk.maps.MapView$SurfaceTextureListener.onSurfaceTextureAvailable(MapView.java:1362)
    at android.view.TextureView.getHardwareLayer(TextureView.java:343)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2967)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.draw(View.java:11085)
    at android.widget.FrameLayout.draw(FrameLayout.java:462)
    at android.view.View.getDisplayList(View.java:10521)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1132)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1377)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.draw(View.java:11085)
    at android.widget.FrameLayout.draw(FrameLayout.java:462)
    at android.view.View.getDisplayList(View.java:10521)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.getDisplayList(View.java:10519)
    at android.view.ViewGroup.drawChild(ViewGroup.java:2954)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
    at android.view.View.draw(View.java:11085)
    at android.widget.FrameLayout.draw(FrameLayout.java:462)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2145)
    at android.view.View.getDisplayList(View.java:10521)
    at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:851)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:1910)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4441)
    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:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)

Android 4.0.4
Sony Ericson
WT19a

@nondefyde
Copy link

nondefyde commented Oct 12, 2016

Same here :

   java.lang.Error: eglCreateWindowSurface() failed
        at com.mapbox.mapboxsdk.maps.NativeMapView.nativeCreateSurface(Native Method)
        at com.mapbox.mapboxsdk.maps.NativeMapView.createSurface(NativeMapView.java:121)
        at com.mapbox.mapboxsdk.maps.MapView$SurfaceCallback.surfaceCreated(MapView.java:1410)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:676)
        at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:203)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)...`......

Is there any fix on this on this?.

0S : Android 6.0
com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.1@aar

@marianoeramirez
Copy link

marianoeramirez commented Jan 4, 2017

Same issue here.

 java.lang.Error: eglSwapInterval() failed
     at com.mapbox.mapboxsdk.maps.NativeMapView.nativeCreateSurface(Native Method)
     at com.mapbox.mapboxsdk.maps.NativeMapView.createSurface(NativeMapView.java:131)
     at com.mapbox.mapboxsdk.maps.MapView$SurfaceCallback.surfaceCreated(MapView.java:1519)
     at android.view.SurfaceView.updateWindow(SurfaceView.java:619)
     at android.view.SurfaceView.access$000(SurfaceView.java:82)
     at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:176)
     at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1624)
     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2452)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:137)
     at android.app.ActivityThread.main(ActivityThread.java:4424)
     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:787)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
     at dalvik.system.NativeStart.main(Native Method)

Android 4.0.3
Device s7-932u

@AlexeyIke
Copy link

Has same error on Optimus L5 (android 4)

@mdholloway
Copy link

Same crash on a Acer R11 Chromebook immediately upon launching our Activity/Fragment containing the map. Android version 6.0.1, Mapbox SDK version 5.0.0.

@joaopedro1520
Copy link

Any ideia when this will be fixed?. My app has more than 200 crashes because of this issue

@kkaefer
Copy link
Contributor

kkaefer commented Jun 22, 2017

This sounds like an instance of #8759, which will be fixed in the upcoming Android SDK 5.1 release.

@mdholloway
Copy link

mdholloway commented Jul 11, 2017

Still crashes on our Chromebook with the 5.1.0 SDK.

@henriquemelissopoulos
Copy link

Maybe the same crash with one device so far:

Mapbox Android SDK 5.1.0
C2004 - Sony Xperia M dual
Android 4.2.2

Fatal Exception: java.lang.Error: program failed to link at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Unknown Source) at com.mapbox.mapboxsdk.maps.NativeMapView.render(Unknown Source) at com.mapbox.mapboxsdk.maps.MapView.onDraw(Unknown Source) at android.view.View.draw(View.java:13806) at android.widget.FrameLayout.draw(FrameLayout.java:467) at android.view.View.getDisplayList(View.java:12736) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2911) at android.view.View.getDisplayList(View.java:12674) at android.view.View.getDisplayList(View.java:12780) at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1210) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2177) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2049) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1858) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4372) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:532) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5085) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(NativeStart.java)

@mdholloway
Copy link

As best I can tell from the commit that added it, the eglSwapInterval call is intended as a performance tweak. Is it really necessary to throw an error if it fails?

If I remove the line throwing the error and rebuild, things look great on the Chromebook.

@mdholloway
Copy link

If that approach is too cavalier, maybe it would be appropriate to throw only if eglGetError returns EGL_BAD_CONTEXT or EGL_BAD_SURFACE (following https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglSwapInterval.xhtml).

On the Chromebook on which I'm reproducing this crash, it's returning EGL_SUCCESS (naturally).

@kkaefer
Copy link
Contributor

kkaefer commented Sep 22, 2017

This will be superseded by #9576

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

No branches or pull requests