Search code examples
androidgeolocationintel-xdk

Intel XDK geo location sample stuck at the first hurdle


I am trying to learn how to build Hybrid apps and am using Intel XDK.

So I installed the software, created a new project using the sample geo location template ( https://software.intel.com/en-us/html5/articles/intel-xdk-geolocation-sample ), tested it using app preview and it was fine so built it for Android.

However when I installed it and went to run it on my phone I got the following error after the splash screen...

"Error calling method on NPObject"

Afterwards I created another project using the same starter template, and this time built it for Crosswalk for Android,

Upon trying both the 86 and the ARM version I got no error, but the map failed to load leaving me with the title and white screen.


Solution

  • The error that you are mentioning is linked to the intel.xdk.geolocation.watchPosition(suc, fail, options) method. The "Error calling method on NPObject" message happens when you try to use methods called from a JavaScript interface to interact with the UI on Android 4.3+.

    I recommend that you use PhoneGap (navigator.geolocation.watchPosition(suc, fail, options)) instead to avoid this error. For more information on using the PhoneGap Geolocation API, visit http://docs.phonegap.com/en/1.5.0/phonegap_geolocation_geolocation.md.html#geolocation.watchPosition