Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic NFC dependencies #459

Open
giuliastully opened this issue Oct 27, 2021 · 2 comments
Open

Ionic NFC dependencies #459

giuliastully opened this issue Oct 27, 2021 · 2 comments

Comments

@giuliastully
Copy link

I'm trying to add NFC plugin to my blank Ionic app.
I use this instruction to install:

    ionic cordova plugin add phonegap-nfc.  
    npm install @ionic-native/nfc

I add import line to app.module.js and add NFC and Ndef to providers:

  import { NFC, Ndef } from "@ionic-native/nfc/ngx";


   @NgModule({
   declarations: [AppComponent],
   entryComponents: [],
   imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
   providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, NFC, Ndef,],
   bootstrap: [AppComponent],
   })
   export class AppModule { }

but when I use "ionic serve" or "ionic cordova build android" i got this error:

An error occurred during the build:
    Error: The target entry-point "@ionic-native/nfc" has missing dependencies:
      - @ionic-native/core
    ...
    ...

How can I solve it?

This is my package.json:

  {
       "name": "example2",
       "version": "0.0.1",
       "author": "Ionic Framework",
       "homepage": "https://ionicframework.com/",
       "scripts": {
       "ng": "ng",
       "start": "ng serve",
       "build": "ng build",
       "test": "ng test",
       "lint": "ng lint",
       "e2e": "ng e2e"
       },
       "private": true,
       "dependencies": {
       "@angular/common": "~12.1.1",
       "@angular/core": "~12.1.1",
       "@angular/forms": "~12.1.1",
       "@angular/platform-browser": "~12.1.1",
       "@angular/platform-browser-dynamic": "~12.1.1",
       "@angular/router": "~12.1.1",
       "@ionic-native/nfc": "^5.36.0",
       "@ionic/angular": "^5.5.2",
       "cordova-android": "9.1.0",
       "rxjs": "~6.6.0",
       "tslib": "^2.2.0",
       "zone.js": "~0.11.4"
       },
       "devDependencies": {
       "@angular-devkit/build-angular": "~12.1.1",
       "@angular-eslint/builder": "~12.0.0",
       "@angular-eslint/eslint-plugin": "~12.0.0",
       "@angular-eslint/eslint-plugin-template": "~12.0.0",
       "@angular-eslint/template-parser": "~12.0.0",
       "@angular/cli": "~12.1.1",
       "@angular/compiler": "~12.1.1",
       "@angular/compiler-cli": "~12.1.1",
       "@angular/language-service": "~12.0.1",
       "@ionic/angular-toolkit": "^4.0.0",
       "@types/jasmine": "~3.6.0",
       "@types/jasminewd2": "~2.0.3",
       "@types/node": "^12.11.1",
       "@typescript-eslint/eslint-plugin": "4.16.1",
       "@typescript-eslint/parser": "4.16.1",
       "cordova-plugin-device": "^2.0.2",
       "cordova-plugin-ionic-keyboard": "^2.2.0",
       "cordova-plugin-ionic-webview": "^4.2.1",
       "cordova-plugin-splashscreen": "^5.0.2",
       "cordova-plugin-statusbar": "^2.4.2",
       "cordova-plugin-whitelist": "^1.3.3",
       "eslint": "^7.6.0",
       "eslint-plugin-import": "2.22.1",
       "eslint-plugin-jsdoc": "30.7.6",
       "eslint-plugin-prefer-arrow": "1.2.2",
       "jasmine-core": "~3.8.0",
       "jasmine-spec-reporter": "~5.0.0",
       "karma": "~6.3.2",
       "karma-chrome-launcher": "~3.1.0",
       "karma-coverage": "~2.0.3",
       "karma-coverage-istanbul-reporter": "~3.0.2",
       "karma-jasmine": "~4.0.0",
       "karma-jasmine-html-reporter": "^1.5.0",
       "phonegap-nfc": "^1.2.0",
       "protractor": "~7.0.0",
       "ts-node": "~8.3.0",
       "typescript": "~4.2.4"
       },
       "description": "An Ionic project",
       "cordova": {
       "plugins": {
           "cordova-plugin-whitelist": {},
           "cordova-plugin-statusbar": {},
           "cordova-plugin-device": {},
           "cordova-plugin-splashscreen": {},
           "cordova-plugin-ionic-webview": {
           "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
           },
           "cordova-plugin-ionic-keyboard": {},
           "phonegap-nfc": {}
       },
       "platforms": [
           "android"
       ]
       }
   }
@phpfs
Copy link

phpfs commented Mar 22, 2022

Did you try this updated guide for ionic with capacitorJS? https://ionicframework.com/docs/native/nfc

@chegewara
Copy link

how about: npm install @ionic-native/core?

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

No branches or pull requests

3 participants