Issue
What I have done:
I'm using Visual Studio, so I edited the package.json file by adding:
- cordova-plugin-geolocation (inside cordovaPlugins array)
- @ionic-native/geolocation (inside dependencies object)
Then I go editing the app.module.ts file by adding:
import { Geolocation } from '@ionic-native/geolocation';
At this point, when I try to run the browser emulation I'll get the following errors:
Failed to load resource: the server responded with a status of 404 (Not Found) : main.css
Failed to load resource: the server responded with a status of 404 (Not Found) : main.js
Failed to load resource: the server responded with a status of 404 (Not Found) : polyfills.js
Also, I tried to import a fake package by writing:
import { Geolocation } from '@ionic-native/dfsdfdsf';
and I get no errors (even if, of course, it does nothing).
Solution
I've put
"cordova-plugin-geolocation": "^2.4.3"
in my package.json's dependencies.
I already had it under 'cordovaPlugins', but it seems it was not enough.
Now it works fine.
Answered By - Riccardo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.