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

end of buffer exception #13477

Closed
suhuangjian opened this issue Nov 29, 2018 · 3 comments
Closed

end of buffer exception #13477

suhuangjian opened this issue Nov 29, 2018 · 3 comments
Labels
Android Mapbox Maps SDK for Android needs information

Comments

@suhuangjian
Copy link

suhuangjian commented Nov 29, 2018

My code

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        Mapbox.getInstance(this, "My key")
        // Create supportMapFragment
        val mapFragment: SupportMapFragment
        if (savedInstanceState == null) {

            // Create fragment
            val transaction = supportFragmentManager.beginTransaction()

            val patagonia = LatLng(-52.6885, -70.1395)

            // Build mapboxMap
            val options = MapboxMapOptions()
            options.styleUrl(Style.SATELLITE)
            options.camera(
                CameraPosition.Builder()
                    .target(patagonia)
                    .zoom(9.0)
                    .build()
            )

            // Create map fragment
            mapFragment = SupportMapFragment.newInstance(options)

            // Add map fragment to parent container
            transaction.add(R.id.container, mapFragment, "com.mapbox.map")
            transaction.commit()
        } else {
            mapFragment = supportFragmentManager.findFragmentByTag("com.mapbox.map") as SupportMapFragment
        }
    }
}

Steps to reproduce

  1. Run the simple demo
  2. Power cut when the logo shows but map not yet show
  3. Restart the app
  4. App crash each time

Expected behavior

Actual behavior

java.lang.Error: end of buffer exception
    at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.nativeRender(Native Method)
    at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onDrawFrame(MapRenderer.java:74)
    at com.mapbox.mapboxsdk.maps.renderer.glsurfaceview.GLSurfaceViewMapRenderer.onDrawFrame(GLSurfaceViewMapRenderer.java:58)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1548)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1259)

Configuration

Android versions: Android 7.1.2
Device models: RK3399
Mapbox SDK versions: 6.7.1

@tobrun
Copy link
Member

tobrun commented Dec 2, 2018

@suhuangjian thank you for reaching out and reporting your problem.
Could you clarify what you mean with Power cut?
Would love to try reproducing this issue.

@tobrun tobrun added Android Mapbox Maps SDK for Android needs information labels Dec 2, 2018
@suhuangjian
Copy link
Author

suhuangjian commented Dec 3, 2018

@tobrun Sorry,it is my fault.
Because our Android device is a vehicle terminal.
So our terminal is no battery, the device is directly connected to the vehicle ACC power.
The power cut means Unplug the power cable and the Android device will shut down immediately witout normal shutdown

@tobrun
Copy link
Member

tobrun commented May 16, 2019

This is a race condition with our binary shaders. Binary shaders have been disabled in #14298 so it won't crash anymore. Follow up on enabling them in long term future is ticketed in #14294.

This fix is available in the v7.4.0 release and is currently being backported to v6.8.x in #14672 (which we aim to release somewhere this week).

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

No branches or pull requests

2 participants