natario1 / CameraView

📸 A well documented, high-level Android interface that makes capturing pictures and videos easy, addressing all of the common issues and needs. Real-time filters, gestures, watermarks, frame processing, RAW, output of any size.
https://natario1.github.io/CameraView
Other
4.89k stars 922 forks source link

NullPointerException at GlTextureDrawer.setFilter #1236

Open EzequielAdrianM opened 1 year ago

EzequielAdrianM commented 1 year ago
Fatal Exception: java.lang.NullPointerException: Attempt to write to field 'e9.b i9.e.d' on a null object reference
       at com.otaliastudios.cameraview.internal.GlTextureDrawer.setFilter(GlTextureDrawer.java:49)
       at com.otaliastudios.cameraview.picture.SnapshotGlPictureRecorder.onRendererFilterChanged(SnapshotGlPictureRecorder.java:122)
       at com.otaliastudios.cameraview.picture.SnapshotGlPictureRecorder$1.onRendererFilterChanged(SnapshotGlPictureRecorder.java:90)
       at com.otaliastudios.cameraview.preview.GlCameraPreview$2.run(GlCameraPreview.java:303)
       at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
       at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)

It looks like somehow, at line (49) of GlTextureDrawer.java, the function setFilter is receiving a null argument thus causing NonNull annotation to raise the exception.

public void setFilter(@NonNull Filter filter) {
        mPendingFilter = filter;
    }

Maybe the NonNull annotation should be removed? Can the app continue working if mPendingFilter is null? This exception appeared at random just in one device in production environment.

ShakeelAziz commented 11 months ago

Facing the same issue, Any one know how to solve this?

big-guogai commented 6 months ago

Facing the same issue, Any one know how to solve this?

abbas427 commented 1 month ago

I'm also facing the same issue, any update on this issue?