No provider for Native-Ionic-Component

I can’t use any native ionic component anymore!

For any native ionic that I try to import I gor this: "No provider for name-of-native-component".


Taking Geolocation for example. In last month I used that way:

import
import { Geolocation } from 'ionic-native';

use
Geolocation.getCurrentPosition().then(...)


Now I follow the doc it’s change, I must do that way:

import
import { Geolocation } from '@ionic-native/geolocation';

declare
constructor(private geolocation: Geolocation) {}

use
this.geolocation.getCurrentPosition().then(...)

But I got this: No provider for Geolocation


I created a new project and got the same error!

What’s wrong? What I miss? I’m getting this No provider for error for any native component that I try to use.

1 Like

You must add them all to the providers stanza of your app module.

5 Likes

That’s worked! Thank you! :slight_smile:

hi,
i am new to ionic. so please give provider list in detail which help to solve issue.

Please update the Ionic documentation with the proper and required steps to work: