Crash when getting location

43 views
Skip to first unread message

Haim Ziko

unread,
Nov 6, 2025, 10:46:04 AM (6 days ago) Nov 6
to Automate for Android
hello ,
i am running on a POCO C75 .

i am trying to get location , when doing so , the flow crashes .

java.lang.illegalstateexception: Failed to get current location: CurrentLocationRequest [HIGH_ACCURACY]

i am not to sure why its happening .
in short whats going is  (i think) , if he cannot get a location it crash , which i think its a weird behavior , why not continue in the flow .. or retry and retry ..

why crashing it ...

what if i were driving  while running the flow and getting my location ... 

Henrik "The Developer" Lindqvist

unread,
Nov 6, 2025, 11:02:17 AM (6 days ago) Nov 6
to Automate for Android
"High accuracy" should cause GPS usage, but even if that was disabled/inaccessible it should cause a failure.
Try toggling the "Google Play service" option in Automate settings.
Use the Failure catch block to handle the failure.

Haim Ziko

unread,
Nov 6, 2025, 11:25:22 AM (6 days ago) Nov 6
to Automate for Android
the google play service api was on .

if you dont mind ,  the failure block comes before or after the "get location" ? 
also , do i need to connect the fail to something ?

what config should i set inside the block ?

thanks 

(do this block is here to say why it failed ?)

Henrik "The Developer" Lindqvist

unread,
Nov 6, 2025, 11:32:47 AM (6 days ago) Nov 6
to Automate for Android
If it was on, then try it off.
As the documentation say, "If a subsequent block cause a failure, the current fiber will retry through the FAIL path for a maximum of retries. Only failures in the current fiber are caught, not in any “child fiber” created by the Fork block."
Indeed, the FAIL path should be connected to something otherwise the flow will stop.

Haim Ziko

unread,
Nov 6, 2025, 11:36:07 AM (6 days ago) Nov 6
to Automate for Android
english is not my main lang , sorry :) 

i did read the documentation but i had difficulty to understand it this is why i asked after reading it 3 times .

so from my understanding , it should come "AFTER" the suspected block .

does it say WHY it failed or this block is just a "retry" block 

thanks .

Henrik "The Developer" Lindqvist

unread,
Nov 6, 2025, 1:40:33 PM (6 days ago) Nov 6
to Automate for Android
The Failure catch block should come before any blocks that may fail.
It outputs a failure type and message.

мJ Zкxy

unread,
Nov 6, 2025, 4:20:23 PM (6 days ago) Nov 6
to Automate for Android
First you could check if its working by open my current location in browser to see if it locate you correctly.
Reply all
Reply to author
Forward
0 new messages