ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 303 forks source link

Ionic 2.rc3 + AngularFire2 + Firebase "Duplicate identifier" errors #507

Closed synga closed 7 years ago

synga commented 7 years ago

Ionic version: (check one with "x") [ ] 1.x [x ] 2.x

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: Trying to build for Android give several erros of 'Duplicate Identifier'.

Expected behavior: No errors.

Description: I've followed Jorge Vergara's tutorials about how to setup AngularFire2 and Firebase for Ionic Projects. When i ionic serve my project it works fine, give no erros and i can use firebase normally, but when i try to build it give lots of erros in _../nodemodules/firebase/firebase.d.ts and _../node_modules/angularfire2/nodemodules/firebase/firebase.d.ts errors

Here is my Package.JSON and ionic infos:

PACKAGE.JSON { "name": "ionic-hello-world", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "2.1.1", "@angular/compiler": "2.1.1", "@angular/compiler-cli": "2.1.1", "@angular/core": "2.1.1", "@angular/forms": "2.1.1", "@angular/http": "2.1.1", "@angular/platform-browser": "2.1.1", "@angular/platform-browser-dynamic": "2.1.1", "@angular/platform-server": "2.1.1", "@ionic/storage": "1.1.6", "@types/jasmine": "^2.5.36", "angularfire2": "^2.0.0-beta.6", "firebase": "^3.6.2", "ionic-angular": "2.0.0-rc.3", "ionic-native": "2.2.3", "ionicons": "3.0.0", "rxjs": "5.0.0-beta.12", "zone.js": "0.6.26" }, "devDependencies": { "@ionic/app-scripts": "0.0.46", "@types/request": "0.0.30", "typescript": "2.0.6" }, "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-console", "cordova-plugin-statusbar", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard" ], "cordovaPlatforms": [], "description": "dracompanha: An Ionic project" }

IONIC INFO: Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.3 Ionic CLI Version: 2.1.13 Ionic App Lib Version: 2.1.7 Ionic App Scripts Version: 0.0.45 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.1 Xcode version: Not installed

I haven't found any other post or issue about this, not on git or ionic forum.

synga commented 7 years ago

Ok so looks like using npm install firebase angularfire2 --save as in this tutorial (https://javebratt.com/ionic2rc0-firebase-angularfire2/) makes it saves firebase 3.3.0 in angularfire node_modules folder and firebase ^3.6.x in app node_modules. Deleting the first one inside angularfire seems to make it work correctly.