For anyone looking at this problem in the future, the geolocation methods are deprecated in Chromium version 50 and higher.
Which means it affects:
-
ionic serve
if tested on Chrome/Chromium v50+.
Solution: use another browser or older Chromium. -
Crosswalk v20 and higher, on device, while using LiveReload
Solution 1: don’t use LiveReload for testing geolocation. It works without it: tryionic run android
without-l
flag
Solution 2: use older Crosswalk - v19 of Crosswalk is using Chromium v49, i.e. one version before deprecation. This can be achieved by adjustingXWALK_VERSION
entry in yourconfig.xml
(see also):
<plugin name="cordova-plugin-crosswalk-webview" spec="https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git">
<variable name="XWALK_VERSION" value="19"/>
<variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+"/>
<variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect"/>
<variable name="XWALK_MODE" value="embedded"/>
<variable name="XWALK_MULTIPLEAPK" value="true"/>
</plugin>