Error finding unlock pin buttons

Hi everyone,
I’ve got an error with “Original error: Error finding unlock pin buttons!” every time I try to set the automation name to “UiAutomator2”. But it’s working if I use “UiAutomator1”. Can someone explain to me why? And how can I fix this?