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)
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" />
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
Most helpful comment
We are also seeing this crash when you update
CameraViewto2.6.3with Kotlin 1.4. For now, moving to a lower version2.6.2works fine