The problem is that the definition of coordinates does not work in Headless mode because currentActivity == null
I propose to change the logic a little, and make sure that in this case the plugin still tries to determine the coordinates.
I give an example on the screenshot