Issue is still reproduced on beta version (1.9.2-beta.2):
8-10-22 16:10:05:568 - info: [debug] [W3C (fa987f2e)] Encountered internal error running command: Error: Cannot parse the actual location values from the command output: Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
2018-10-22 16:10:05:568 - info: [debug] [W3C (fa987f2e)] Broadcast completed: result=0, data=""
2018-10-22 16:10:05:569 - info: [debug] [W3C (fa987f2e)] at ADB.<anonymous> (C:\Users\ihor.hanets\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\adb-commands.js:914:11)
2018-10-22 16:10:05:569 - info: [debug] [W3C (fa987f2e)] at Generator.next (<anonymous>)
2018-10-22 16:10:05:569 - info: [debug] [W3C (fa987f2e)] at asyncGeneratorStep (C:\Users\ihor.hanets\AppData\Roaming\npm\node_modules\appium\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24)
2018-10-22 16:10:05:569 - info: [debug] [W3C (fa987f2e)] at _next (C:\Users\ihor.hanets\AppData\Roaming\npm\node_modules\appium\node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9)
2018-10-22 16:10:05:571 - info: [debug] [W3C (fa987f2e)] at <anonymous>
Code to reproduce:
Location location = new Location(50., 50., 0);
driver.setLocation(location);
@mykola-mokhnach I’m too facing the same parse error while getting the location. As like you mentioned, I’ve installed 1.9.2-beta.2. But, still the same issue persists. Can you check and fix it ASAP. It would be helpful for us.
LOG:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot parse the actual location values from the command output: Broadcasting: Intent { act=io.appium.settings.location flg=0x400000 cmp=io.appium.settings/.receivers.LocationInfoReceiver }
Broadcast completed: result=0, data=""
Make sure that Appium Settings utility is up to date. If not then download and install it manually from https://github.com/appium/io.appium.settings26
@mykola-mokhnach I’ve downloaded the io.appium.settings and installed the latest 2.9.0 build in device. But still I’m getting the same issue. I’m using android 8. When would I expect the latest changes to be published for this fix? Thanks!
@mykola-mokhnach I’ve attached the logcat logs for Appium settings (io.appium.settings).
11-01 15:50:41.286: D/LocationInfoReceiver(28047): Getting current location
11-01 15:50:41.304: E/GPSTracker(28047): Appium Settings has no access to FINE location permission
11-01 15:50:41.310: E/GPSTracker(28047): Appium Settings has no access to COARSE location permission
After looking into these logs, I just enabled the location permission for Appium settings app. Then I can able to get the location information. This is fine for now. But it would be more fine if the location permission is enabled by default.
@mykola-mokhnach I need one more clarification regarding enable the location using Appium driver? Is there any way to do this? As of now I’m using ADB command to enable the location. But it would be much better if the method is available in Appium.
Okay @mykola-mokhnach that is fine. What about enable/disable device location using driver? Is there a way in appium?
@mykola-mokhnach But it’s possible to run adb command in appium since I’ve seen in appium logs that the adb commands are getting executed to interact with devices. Then why can’t you do enable/disable location with appium since there are adb commands to enable/disable location? Can you take it as a feature request?
@mykola-mokhnach As of now I’m using the following ADB commands to enable/disable the location in device
CMD_GET_GLOBAL_LOCATION_STATUS = “adb shell settings get secure location_providers_allowed”;
CMD_ENABLE_GLOBAL_LOCATION = “adb shell settings put secure location_providers_allowed +network,gps”;
CMD_DISABLE_GLOBAL_LOCATION = “adb shell settings put secure location_providers_allowed -”;
But if you’re planning to add these chnages you need to check these commands are working for all android versions.
@mykola-mokhnach I’m getting the same parse error again while fetching the location using driver. I’m using fake gps app to mock the location. Once I set the fake location in device using fake gps app, I can’t able to see the output for driver.location().
Any ideas on how to make it work?
I just uninstall the appium settings and reinstalled again (2.9.0), All permissions are enabled. But still no luck.
LOG:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot parse the actual location values from the command output: Broadcasting: Intent { act=io.appium.settings.location cmp=io.appium.settings/.receivers.LocationInfoReceiver launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } }
Broadcast completed: result=0, data=""
Appium allows to run arbitrary adb commands: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/android-shell.md14