Skip to content

java.lang.NullPointerException: Attempt to invoke interface method 'int io.flutter.view.TextureRegistry$SurfaceProducer.getWidth()' on a null object reference #248

@yanshi2516

Description

@yanshi2516

E/AndroidRuntime(27851): java.lang.NullPointerException: Attempt to invoke interface method 'int io.flutter.view.TextureRegistry$SurfaceProducer.getWidth()' on a null object reference
E/AndroidRuntime(27851): at io.flutter.plugin.platform.SurfaceProducerPlatformViewRenderTarget.getWidth(SurfaceProducerPlatformViewRenderTarget.java:25)
E/AndroidRuntime(27851): at io.flutter.plugin.platform.VirtualDisplayController.getRenderTargetWidth(VirtualDisplayController.java:132)
E/AndroidRuntime(27851): at io.flutter.plugin.platform.PlatformViewsController$1.lambda$resize$0$io-flutter-plugin-platform-PlatformViewsController$1(PlatformViewsController.java:352)
E/AndroidRuntime(27851): at io.flutter.plugin.platform.PlatformViewsController$1$$ExternalSyntheticLambda0.run(Unknown Source:8)
E/AndroidRuntime(27851): at android.os.Handler.handleCallback(Handler.java:1000)
E/AndroidRuntime(27851): at android.os.Handler.dispatchMessage(Handler.java:104)
E/AndroidRuntime(27851): at android.os.Looper.loopOnce(Looper.java:242)
E/AndroidRuntime(27851): at android.os.Looper.loop(Looper.java:362)
E/AndroidRuntime(27851): at android.app.ActivityThread.main(ActivityThread.java:8448)
E/AndroidRuntime(27851): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27851): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime(27851): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
D/BufferQueueProducer(27851): ImageReader-1080x2340f22m5-27851-0 disconnect: api 1
I/Process (27851): Sending signal. PID: 27851 SIG: 9

I am using library and while disposing the screen it shows me the error and app crashes. How can I resolve it? Thanks in advance

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