[Android Permissions]: requestPermission throws an Unknown error

I am getting the following error when requesting the user permission:

{
   "error": "requestPermission",
   "message": "Unknown error."
}

Here’s a code snippet for checking and requesting permission:

let PERMISSIONS_NEEDED = [
   this.androidPermissions.PERMISSION.CAMERA, 
   this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE
];

this.androidPermissions.checkPermission(PERMISSIONS_NEEDED[0]).then((result) => {
   
   // If no permission, request permission.
   if (!result.hasPermission || result.hasPermission == false || result.hasPermission == "false") {
      alert("REQUEST-PERMISSION");
      this.androidPermissions.requestPermissions(PERMISSIONS_NEEDED).then((_) => {
         alert("PERMISSION-GIVEN");
      })
      .catch(err => {
         alert("REQUEST-PERMISSION-ERROR: " + JSON.stringify(err)); // <<<<<<<<<<<<<<<< error
      });
   }
   // If permission is already granted, proceed normally.
   else {
      alert("ALREADY-HAVE-PERMISSION");
   }
}

Additional Information:

are you testing on which device? version?
can you try official one code which is in docs

The code I shared above is almost the same as the official docs. The code works on regular Android and iOS devices.

I am only getting the issue with Zebra TC51 (Android 6) – the plugin successfully checks if device has permission or not but it fails to request permission (it was working fine few weeks ago). Additional test has been done on a similar TC device and it is working fine. So, this seems to be a device issue at this point.