Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: Surface had no valid native window #8

Open
wisnuwiry opened this issue May 17, 2021 · 2 comments
Open

IllegalArgumentException: Surface had no valid native window #8

wisnuwiry opened this issue May 17, 2021 · 2 comments
Labels
question Further information is requested

Comments

@wisnuwiry
Copy link

wisnuwiry commented May 17, 2021

Description

If the application finds an error, then the application immediately forces close

How to reproduce error

  1. Run-on Android 5 on Emulator.
  2. Stop controller
  3. Wait until force close

Logs:

E/AndroidRuntime( 3642): java.lang.IllegalArgumentException: Surface had no valid native window.
E/AndroidRuntime( 3642): 	at android.hardware.camera2.legacy.LegacyCameraDevice.nativeSetSurfaceFormat(Native Method)
E/AndroidRuntime( 3642): 	at android.hardware.camera2.legacy.LegacyCameraDevice.setSurfaceFormat(LegacyCameraDevice.java:591)
E/AndroidRuntime( 3642): 	at android.hardware.camera2.legacy.RequestThreadManager.resetJpegSurfaceFormats(RequestThreadManager.java:505)
E/AndroidRuntime( 3642): 	at android.hardware.camera2.legacy.RequestThreadManager.access$2300(RequestThreadManager.java:63)
E/AndroidRuntime( 3642): 	at android.hardware.camera2.legacy.RequestThreadManager$5.handleMessage(RequestThreadManager.java:915)
E/AndroidRuntime( 3642): 	at android.os.Handler.dispatchMessage(Handler.java:98)
E/AndroidRuntime( 3642): 	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 3642): 	at android.os.HandlerThread.run(HandlerThread.java:61)

@yanshouwang
Copy link
Owner

Can you write a sample for me, is this only happened on Android 5.0?

@yanshouwang
Copy link
Owner

The CameraX library doesn't work well on emulators with Android 10 or lower, look at this link, you can try your codes on a physical device:)

@yanshouwang yanshouwang added the question Further information is requested label Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants