# 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:** 4\
**Page:** 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! 🙂**

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [August 10, 2016, 7:59pm UTC](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127/2 "2016-08-10T19:59:14Z")

</div>

Hi,

This is currently a known issue, and our Android SDK Engineers are working to provide a fix. I’ll post here again once the new release with the fix is available.

Michelle

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [August 12, 2016, 6:56am UTC](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127/3 "2016-08-12T06:56:32Z")

</div>

Hi,

A new release of the Android SDK is now out that addresses this issue. Do please download the new SDK release from the link provided through email.

Michelle

---

<div class="post-metadata">

**Author:** ![Thomas\_Forsberg](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@Thomas\_Forsberg](https://community.wowza.com/u/Thomas_Forsberg)\
**Post date:** [February 5, 2018, 10:36am UTC](https://community.wowza.com/t/wzcamera-failing-on-devices-with-only-one-camera/47127/4 "2018-02-05T10:36:44Z")

</div>

Could the single camera issue be back in latest SDK and Android GoCoder? Please see post [http://community.wowza.com/community/questions/47299/problem-with-usb-camera-on-android.html](http://community.wowza.com/community/questions/47299/problem-with-usb-camera-on-android.html)
