I was able to reproduce this error on a Lenovo YT3-850F (Android 5.1.1), Nexus 7 2012 (Android 5.1.1) and on a Genymotion Emulator (Android 5.0.0) with Nexus 5 configurations.
After calling
this.cameraView = (WZCameraView) root.findViewById(R.id.camera_preview);
the cameraView is null, looking into your code I found that the SDK is detecting the camera like this on the Lenovo device:
https://www.dropbox.com/s/nmplku7y7p4kzs7/Screenshot%202016-08-04%2016.03.47.png?dl=0
mCameras:
camera id : 0
direction : back
available : yes
preview sizes supported : [144x176, 160x120, 176x144, 240x160, 320x240, 352x288, 384x288, 480x360, 576x432, 640x480, 720x480, 768x432, 800x480, 864x480, 1280x960, 1280x720, 1920x1080]
focus modes supported : [auto, infinity, macro, continuous-video, continuous-picture, manual]
torch supported : no
f:
scaleMode : FILL_VIEW
viewSize : 0x0 (null)
surfaceSize : 0x0 (null)
clientFrameSize : 640x480 (4:3)
activeFrameSize : 640x480 (4:3)
surfaceRotation : 1
Object state taken from:
public WZCamera getCamera() {
return this.mActiveCamera;
}
--------------------------------------------------------
So, inside the WZCamera the “l” Camera Object and “m” SurfaceTexture are both null.
I tracked down the reason of this and came to the startPreview() method in the WZCameraView class:
https://www.dropbox.com/s/26rfy5pxwm2nshg/Screenshot%202016-08-04%2017.42.45.png?dl=0
And as you can see, b() is true but still if(!this.b()) is also true and thus the entire method is returning a null WZCamera.
Screenshot of b() being executed, where mCameras.length > 0 should return true:
https://www.dropbox.com/s/iebe3y94qdewr30/Screenshot%202016-08-04%2016.03.15.png?dl=0
Objects mentioned above: https://www.dropbox.com/s/oij80wxu8op0pqu/Screenshot%202016-08-04%2016.26.12.png?dl=0
So… all this is disabling the SDK from showing or streaming any video at all, only audio. We need to get our application running on the Lenovo device and would deeply appreciate any fix or workaround for this.
Thank you!