Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

NullInjectorError: No provider for Contacts! #209

Closed
leandroblanes opened this issue Mar 18, 2019 · 3 comments
Closed

NullInjectorError: No provider for Contacts! #209

leandroblanes opened this issue Mar 18, 2019 · 3 comments

Comments

@leandroblanes
Copy link

Bug Report

Problem

I followed the documentation of the link https://ionicframework.com/docs/native/contacts but when running on the device I get the error 'NullInjectorError: No provider for Contacts!'

Chrome Inspect Log

ERROR Error: StaticInjectorError(AppModule)[Contacts]: StaticInjectorError(Platform: core)[Contacts]: NullInjectorError: No provider for Contacts! at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:8895) at resolveToken (core.js:9140) at tryResolveToken (core.js:9084) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8981) at resolveToken (core.js:9140) at tryResolveToken (core.js:9084) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8981) at resolveNgModuleDep (core.js:21217) at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:21906) at injectInjectorOnly (core.js:1773)

Ionic Info

`Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\Leandro\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.1.1
@angular-devkit/build-angular : 0.13.5
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.5
@ionic/angular-toolkit : 1.4.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : not available

System:

Android SDK Tools : 26.1.1 (C:\Users\Leandro\AppData\Local\Android\Sdk)
NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.7.0
OS : Windows 7`

@Bramzor
Copy link

Bramzor commented Apr 4, 2019

This is basic angular and has nothing to do with this plugin. You always need to add an import inside app.module.ts and add it to the Providers array.

@DaSchTour
Copy link

This is basic angular and has nothing to do with this plugin. You always need to add an import inside app.module.ts and add it to the Providers array.

I'm not sure if that's so clear to everyone. The documentation of the plugins doesn't tell about this. And from angular you could expect, that Injectable could be provided at root and would not need any provider declaration.

@breautek
Copy link

The documentation of the plugins doesn't tell about this.

We don't document any details on any particular framework. Doing so would be a major hurdle in maintenance, especially for the small volunteer team that we are. Cordova documents the API that Cordova defines and any potential quirks you may run into on a particular OS / webview platform. Anything outside of that is out of scope.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants