# WZCamera failing on devices with only one camera

**URL:** <https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127>\
**Category:** Wowza GoCoder SDK\
**Created:** [August 4, 2016, 5:06pm UTC](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127 "2016-08-04T17:06:22Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_H](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alejandro\_H](https://community.wowza.com/u/Alejandro_H)\
**Post date:** [August 4, 2016, 5:06pm UTC](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127/1 "2016-08-04T17:06:22Z")

</div>

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](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](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](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](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! 🙂**

---

_[View the full topic](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127)._
