CameraView crashing if using kotlin 1.4.0 and glsurface as preview rendered

Created on 18 Aug 2020  路  6Comments  路  Source: natario1/CameraView

Describe the bug

If the project is set to use kotlin plugin 1.4.0 and glsurface as preview rendered the view will crash. Using texture everything works as exptected.
The crash generated:

com.otaliastudios.cameraview.demo E/AndroidRuntime: FATAL EXCEPTION: GLThread 1048
    Process: com.otaliastudios.cameraview.demo, PID: 25268
    java.lang.NoSuchMethodError: No static method get-impl([II)I in class Lkotlin/UIntArray; or its super classes (declaration of 'kotlin.UIntArray' appears in /data/app/com.otaliastudios.cameraview.demo-CxUbH86-QP-L_J6AbBIO2Q==/base.apk)
        at com.otaliastudios.opengl.texture.GlTexture.<init>(GlTexture.kt:90)
        at com.otaliastudios.opengl.texture.GlTexture.<init>(GlTexture.kt:23)
        at com.otaliastudios.opengl.texture.GlTexture.<init>(GlTexture.kt:22)
        at com.otaliastudios.opengl.texture.GlTexture.<init>(Unknown Source:6)
        at com.otaliastudios.cameraview.internal.GlTextureDrawer.<init>(GlTextureDrawer.java:35)
        at com.otaliastudios.cameraview.preview.GlCameraPreview$Renderer.onSurfaceCreated(GlCameraPreview.java:148)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1541)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
  • CameraView version: 2.6.3
  • Camera engine used: camera2
  • Reproducible in official demo app: yes
  • Device / Android version: OnePlus 3/9
  • I have read the FAQ page: yes

To Reproduce

Just set the demo project using kotlin 1.4.0:

    extra["kotlinVersion"] = "1.4.0"

and cameraviewPreview to use glsurface:

    <com.otaliastudios.cameraview.CameraView
        ....
        app:cameraPreview="glSurface" />
bug

Most helpful comment

We are also seeing this crash when you update CameraView to 2.6.3 with Kotlin 1.4. For now, moving to a lower version 2.6.2 works fine

All 6 comments

I'm experiencing the same issue.

Just updated to Kotlin 1.4.0 and ran into the same problem!

Happens also to me

also for me, on google pixel emulator android 10

Same here, currently not able to upgrade to Kotlin:1.4.0 because of this issue. Not a big deal but able reproduce for any version bigger than Kitkat.

We are also seeing this crash when you update CameraView to 2.6.3 with Kotlin 1.4. For now, moving to a lower version 2.6.2 works fine

Was this page helpful?
0 / 5 - 0 ratings