native.showPopup showing error in logcat

I’m using native.showPopup to ask for Camera permission.  It appears that everything is working right, but I get the following error in logcat:

CoronaActivity.DefaultRequestPermissionResultHandler.forwardRequestPermissionResultToLua(): cannot forward results to Lua as no Registry ID was found!

I’m getting the permission granted in my Listener, and my app looks to be operating accordingly.  Does this error leave me a problem under the covers?

Thanks

Dave

Can you post the code for your popup?
 

Rob

local function getImages(event) fName = os.time(os.date("!\*t")) local hasAccessToCamera, hasCamera local hasAccessToCamera, hasCamera = media.hasSource( media.Camera ) if ( hasAccessToCamera == true ) then -- There is access to the camera media.capturePhoto( { listener = onComplete } ) elseif ( hasCamera == true and native.canShowPopup( "requestAppPermission" ) ) then local function appPermissionsListener( event ) for k,v in pairs( event.grantedAppPermissions ) do if ( v == "Camera" ) then print("we got camera") timer.performWithDelay(300, getImages,1) return end end timer.performWithDelay(300, backArrowListener, 1) end local options = { appPermission = "Camera", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Camera access required", rationaleDescription = "Camera access is required to take photos. Re-request now?", -- settingsRedirectTitle = "Alert", -- settingsRedirectDescription = "Without the ability to take photos, this app cannot properly function. Please grant camera access within Settings." } native.showPopup( "requestAppPermission", options ) end we dont crash on it, below is from logcat my print: 02-24 15:55:11.225 10235 10252 I Corona : applicationExit or applicationSuspend: db closed your print: 02-24 15:55:13.215 10235 10235 D Corona : Execute the lua listener task your print: 02-24 15:55:13.215 10235 10235 I Corona : ERROR: CoronaActivity.DefaultRequestPermissiosnResultHandler.forwardRequestPermissionsResultToLua():Cannot forward results to Lua as no registry ID was found! my print: 02-24 15:55:13.265 10235 10252 I Corona : db opened my print: 02-24 15:55:13.265 10235 10252 I Corona : db reopened

Can you post the code for your popup?
 

Rob

local function getImages(event) fName = os.time(os.date("!\*t")) local hasAccessToCamera, hasCamera local hasAccessToCamera, hasCamera = media.hasSource( media.Camera ) if ( hasAccessToCamera == true ) then -- There is access to the camera media.capturePhoto( { listener = onComplete } ) elseif ( hasCamera == true and native.canShowPopup( "requestAppPermission" ) ) then local function appPermissionsListener( event ) for k,v in pairs( event.grantedAppPermissions ) do if ( v == "Camera" ) then print("we got camera") timer.performWithDelay(300, getImages,1) return end end timer.performWithDelay(300, backArrowListener, 1) end local options = { appPermission = "Camera", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Camera access required", rationaleDescription = "Camera access is required to take photos. Re-request now?", -- settingsRedirectTitle = "Alert", -- settingsRedirectDescription = "Without the ability to take photos, this app cannot properly function. Please grant camera access within Settings." } native.showPopup( "requestAppPermission", options ) end we dont crash on it, below is from logcat my print: 02-24 15:55:11.225 10235 10252 I Corona : applicationExit or applicationSuspend: db closed your print: 02-24 15:55:13.215 10235 10235 D Corona : Execute the lua listener task your print: 02-24 15:55:13.215 10235 10235 I Corona : ERROR: CoronaActivity.DefaultRequestPermissiosnResultHandler.forwardRequestPermissionsResultToLua():Cannot forward results to Lua as no registry ID was found! my print: 02-24 15:55:13.265 10235 10252 I Corona : db opened my print: 02-24 15:55:13.265 10235 10252 I Corona : db reopened

Just to share. I also had this problem. It is because the camera requires 2 permissions :

  1. Storage (e.g. android.permission.WRITE_EXTERNAL_STORAGE)

  2. Camera

So, if you already have just Camera permission (and not Storage permission), it will ‘automatically’ ask for Storage permission when the ‘media.capturePhoto()’ is called.  When the Storage permission is given, there is no call back function and thus this error occurs.

To solve this, I ask for Storage permission first, and if given, then only I will ask for the Camera permission.

Just to share. I also had this problem. It is because the camera requires 2 permissions :

  1. Storage (e.g. android.permission.WRITE_EXTERNAL_STORAGE)

  2. Camera

So, if you already have just Camera permission (and not Storage permission), it will ‘automatically’ ask for Storage permission when the ‘media.capturePhoto()’ is called.  When the Storage permission is given, there is no call back function and thus this error occurs.

To solve this, I ask for Storage permission first, and if given, then only I will ask for the Camera permission.