Error: This device does not have a camera.

Hello,

This might look like a silly problem, but i get a dialog box on the app showing:
“Corona - This device does not have a camera - OK.” 
While it works on simulator when i test on a galaxy SII real device it won’t.

Code used is exact same example at the end of this page:
https://docs.coronalabs.com/api/library/media/capturePhoto.html

I have setup the user permissions on build.setting.
Do you  have any idea what is causing it?

Regards

Can you post your build settings and the code that makes the camera and lets you take a picture?

Thanks!

--build.setting android={ usesPermissions={ "android.permission.INTERNET", "android.permission.CAMERA", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, },

local function onComplete( event ) local photo = event.target print( "photo w,h = " .. photo.width .. "," .. photo.height ) end if media.hasSource( media.Camera ) then media.capturePhoto( { listener=onComplete } ) else native.showAlert( "Corona", "This device does not have a camera.", { "OK" } ) end

Thank you!

Here’s a link that might helped…

 

https://forums.coronalabs.com/topic/35071-adding-camera-permission-makes-so-app-does-not-install-on-galaxy-tab-2/

 

I never used camera but ill try to help all i can!

 

and look here also … https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#androidsettings

 

Good Luck!

Hi @SonicX278,

I appreciate your help, tried to add “usesFeatures” on lowercase, as “usesPermissions” seem to be OK uppercase, but it didn’t make any difference. I still get the same error.

Can you post your build settings and the code that makes the camera and lets you take a picture?

Thanks!

--build.setting android={ usesPermissions={ "android.permission.INTERNET", "android.permission.CAMERA", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, },

local function onComplete( event ) local photo = event.target print( "photo w,h = " .. photo.width .. "," .. photo.height ) end if media.hasSource( media.Camera ) then media.capturePhoto( { listener=onComplete } ) else native.showAlert( "Corona", "This device does not have a camera.", { "OK" } ) end

Thank you!

Here’s a link that might helped…

 

https://forums.coronalabs.com/topic/35071-adding-camera-permission-makes-so-app-does-not-install-on-galaxy-tab-2/

 

I never used camera but ill try to help all i can!

 

and look here also … https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#androidsettings

 

Good Luck!

Hi @SonicX278,

I appreciate your help, tried to add “usesFeatures” on lowercase, as “usesPermissions” seem to be OK uppercase, but it didn’t make any difference. I still get the same error.