I just tried to follow the docs guidelines for Facebook SDK https://ionicframework.com/docs/native/facebook/ …but after I import Facebook in my controllers, I am getting this error while build ,
can't resolve module @ionic-native/core from ../node_modules/@ionic-native/facebook/index.d.ts
Error: Cannot read property 'Plugin' of undefined, resolving symbol Facebook in ../node_modules/@ionic-native/facebook/index.d.ts
again i am finding a lot of errors in translate, navCtrl etc. modules which was perfectly fine a day before. I am finding no clue what went wrong.
@Sujan12 , removed the “ionic-native”: “2.2.3” dependency from package.json. then followed the exact steps from ionic/docs/facebook.
First it shows warning of UNMET PEER DEPENDENCY @ionic-native/core@^3.1.0 and UNMET DEPENDENCY rxjs@5.0.0-beta.12
Ignoring these warnings, I could build the apk at this stage with Facebook imported in @NgModule (app.module.ts), but when it launched in phone, the screen was white and inspected console as Uncaught Error: Cannot find module "@ionic-native/core"
And then i installed ionic-native/core from https://www.npmjs.com/package/ionic-native. and it showed warning UNMET DEPENDENCY rxjs@5.0.0-beta.12 even though my package.json consists of “rxjs”: “5.0.0-beta.12”,
Ignoring the warning, i tried to build the apk, but found the same error as
can't resolve module @ionic-native/core from ../node_modules/@ionic-native/facebook/index.d.ts
Error: Cannot read property 'Plugin' of undefined, resolving symbol Facebook in ../node_modules/@ionic-native/facebook/index.d.ts
The problems is, I am using ng2-translate too in my app. So when I install updated plugins for facebook or native/core , they are being installed as per the latest version , but my ng2-translate requires some other version of the same modules i.e @angular/core, @angular/http, rxjs etc etc. Can you please suggest me a suitable combinations of module versions that will work for facebook, ng2-translate and ionic-native/core modules? I am at a loss …
The thing is , Ionic is upgrading to newer versions and it is introducing pretty good changes in plugin integration just like ng2-translate. I am getting error in many native modules while building the apk with this package "@angular/common": "2.4.8", "@angular/compiler": "2.4.8", "@angular/compiler-cli": "2.4.8", "@angular/core": "2.4.8", "@angular/forms": "2.4.8", "@angular/http": "2.4.8", "@angular/platform-browser": "2.4.8", "@angular/platform-browser-dynamic": "2.4.8", "@angular/platform-server": "2.4.8", "@ionic/storage": "2.0.0", "ionic-angular": "2.2.0", "@ionic-native/core": "3.1.0", "@ionic-native/facebook": "3.1.0", "ionic-native": "2.4.1", "ionicons": "3.0.0", "rxjs": "5.0.1", "sw-toolbox": "3.4.0", "zone.js": "0.7.2", "ng2-translate": "^4.0.0",
in Contacts, Device etc etc. So now if I update to the latest version , I will have to change the whole translate process in my app which is really cumbersome!!! But I will have to since I need facebook sdk too. I was trying to avoid changing existing plugin integration, but seems it is the only way left !