Appium unable to unlock android device with capabilities

Following are the capabilities:
[Appium] Creating new AndroidDriver (v1.28.1) session
[Appium] Capabilities:
[Appium] appPackage: ‘’
[Appium] appActivity: ‘’
[Appium] newCommandTimeout: 2500
[Appium] platformVersion: ‘6.0.1’
[Appium] unlockType: ‘pin’
[Appium] udid: ‘d3766a9f7d73’
[Appium] platformName: ‘Android’
[Appium] unlockKey: ‘1234’
[Appium] deviceName: ‘Xiaomi Redmi 4A’

[MJSONWP] Encountered internal error running command: Error: Error finding unlock pin buttons!
at callee$0$0$ (/Applications/
at tryCatch (/Applications/
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/
at GeneratorFunctionPrototype.invoke (/Applications/
at process._tickCallback (internal/process/next_tick.js:103:7)

When my device is locked and if i ran my program, it is giving the following error. Appium is able to swipe but not able to enter the pin and throwing this error. Did anyone face the similar issue? Please help!!

Appium v1.7.1
Device: RedMi 4A with 6.0.1

Please let me know if any more details needed. Thanks in Advance!!!