Skip to content

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getHeight()' on a null object reference #1279

Description

@khiemdnt

Describe the bug

Please add a clear description of what the bug is, and fill the list below.

  • CameraView version: 2.7.2
  • Camera engine used: camera2
  • Device / Android version: Pixel, API 30

Hello, thank you for helpful this repository.

I implement cameraview in fragment and then I found crash in firebase crashlytics.
So, I want how to fix it.
thank you

Bug:

      Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getHeight()' on a null object reference
   at android.widget.TextView.getVerticalOffset(TextView.java:7722)
   at android.widget.TextView.onDraw(TextView.java:8358)
   at android.view.View.draw(View.java:23626)
   at android.view.View.updateDisplayListIfDirty(View.java:22422)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4627)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4600)
   at android.view.View.updateDisplayListIfDirty(View.java:22352)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4627)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4600)
   at android.view.View.updateDisplayListIfDirty(View.java:22352)
   at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4627)
   at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4600)
   at android.view.View.updateDisplayListIfDirty(View.java:22352)
   at android.view.View.draw(View.java:23325)
   at android.view.ViewGroup.drawChild(ViewGroup.java:4643)
   at com.otaliastudios.cameraview.overlay.OverlayLayout.doDrawChild(OverlayLayout.java:180)
   at com.otaliastudios.cameraview.overlay.OverlayLayout.drawChild(OverlayLayout.java:169)
   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4401)
   at com.otaliastudios.cameraview.overlay.OverlayLayout.drawOn(OverlayLayout.java:151)
   at com.otaliastudios.cameraview.overlay.OverlayDrawer.draw(OverlayDrawer.java:74)
   at com.otaliastudios.cameraview.video.encoding.TextureMediaEncoder.onFrame(TextureMediaEncoder.java:218)
   at com.otaliastudios.cameraview.video.encoding.TextureMediaEncoder.onEvent(TextureMediaEncoder.java:146)
   at com.otaliastudios.cameraview.video.encoding.MediaEncoder$3.run(MediaEncoder.java:244)
   at android.os.Handler.handleCallback(Handler.java:942)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loopOnce(Looper.java:211)
   at android.os.Looper.loop(Looper.java:300)
   at android.os.HandlerThread.run(HandlerThread.java:67)

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions