angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

I have problems with the command Ionic 3 and Firebase and angularfire2

Open alsit opened this issue 8 years ago • 6 comments

I have problems with the command

ionic cordova build android --prod --release

In Ionic 3 And Firebase use plugin angularfire2

When I execute it, it starts but stays locked indefinitely and never ends.

sample run result command Running app-scripts build: --prod --platform android --target cordova

[13:30:05] build prod started ... [13:30:05] clean started ... [13:30:05] clean finished in 2 ms [13:30:05] copy started ... [13:30:05] deeplinks started ... [13:30:06] deeplinks finished in 122 ms [13:30:06] ngc started ... [13:30:16] ngc finished in 10.44 s [13:30:16] preprocess started ... [13:30:16] preprocess finished in 1 ms [13:30:16] webpack started ... [13:30:16] copy finished in 10.92 s

I have verified that it crashes when I use the Firebase plugin angularfire2 with the modules AngularFireDatabaseModule, AngularFireDatabase. I have tried different versions of angularfire2

I tried this

npm install [email protected] npm install firebase@^4.5.0

It is also

npm install angularfire2 firebase promise-polyfill --save npm install --save @ firebase / app-types

I have a MacPro this is the configuration

node -v v8.11.0

npm -v 5.8.0

ng -v Angular CLI: 6.0.1 Node: 8.11.0 OS: darwin x64 Angular: 5.2.9 ... animations, common, compiler, compiler-cli, core, forms ... http, platform-browser, platform-browser-dynamic

Package Version


@ angular-devkit / architect 0.6.1 @ angular-devkit / build-optimizer 0.0.35 @ angular-devkit / core 0.6.1 @ angular-devkit / schematics 0.6.1 @ angular / cli 6.0.1 @ schematics / angular 0.6.1 @ schematics / update 0.6.1 rxjs 5.5.8 typescript 2.6.2 webpack 3.8.1

cordova -v 8.0.0

ionic -v 3.20.0

ionic info

cli packages: (/ usr / local / lib / node_modules)

@ ionic / cli-utils: 1.19.2
ionic (Ionic CLI): 3.20.0

global packages:

Cordova (Cordova CLI): 8.0.0

local packages:

@ ionic / app-scripts: 3.1.9
Cordova Platforms: android 6.3.0
Ionic Framework: ionic-angular 3.9.2

System:

Android SDK Tools: 26.1.1
ios-deploy: 1.9.2
Node: v8.11.0
npm: 5.8.0
OS: macOS High Sierra
Xcode: Xcode 9.3.1 Build version 9E501

Environment Variables:

ANDROID_HOME: / Users / user / Developed / Android / sdk

Misc:

backend: pro

Someone has some idea that can be.

If I use the command ionic cordova build android --release It works fine but causes a delay in opening the application after while screen of about 8 seconds

alsit avatar May 12 '18 00:05 alsit

remove platforms and plugins and node_modules then install it again. what your @angular version? is that 6?

hiepxanh avatar May 12 '18 04:05 hiepxanh

I have already tried removing the platform, deleting the node_modules and the plugins, and I still have the same problem. For this reason, I consulted with you. Below I leave the output of the ng v command that executes it in the project directory.

ng v Angular CLI: 1.6.1 Node: 8.11.0 OS: darwin x64 Angular: 5.2.9 ... animations, common, compiler, compiler-cli, core, forms ... http, platform-browser, platform-browser-dynamic

@angular-devkit/build-optimizer: 0.0.35 typescript: 2.6.2 webpack: 3.8.1

alsit avatar May 12 '18 11:05 alsit

Configuration app.module.ts

import {BrowserModule} from '@ angular / platform-browser'; import {ErrorHandler, NgModule} from '@ angular / core'; import {IonicApp, IonicErrorHandler, IonicModule} from 'ionic-angular'; import {SplashScreen} from '@ ionic-native / splash-screen'; import {StatusBar} from '@ ionic-native / status-bar';

import {MyApp} from './app.component'; import {HomePage} from '../pages/home/home';

import {AdMobFree} from '@ ionic-native / admob-free';

import {AngularFireModule} from 'angularfire2'; import {AngularFireDatabaseModule, AngularFireDatabase} from 'angularfire2 / database'; import {AngularFireAuthModule} from 'angularfire2 / auth';

export const firebaseConfig = { apiKey: "xxxxxxxx", authDomain: "xxxxxxxx", databaseURL: "xxxxxxxx", projectId: "xxxxxxx", storageBucket: "xxxxxx", messagingSenderId: "xxxxx" };

@NgModule ({ declarations: [ MyApp, Homepage ], imports: [ BrowserModule, IonicModule.forRoot (MyApp), AngularFireModule.initializeApp (firebaseConfig), AngularFireDatabaseModule, AngularFireAuthModule ], bootstrap: [IonicApp], entryComponents: [ MyApp, Homepage ], providers: [ StatusBar, SplashScreen, AdMobFree, AngularFireDatabase, {provide: ErrorHandler, useClass: IonicErrorHandler} ] }) export class AppModule {}

When in the imports I add AngularFireDatabaseModule and in the providers AngularFireDatabase is when the command is blocked ionic cordova build android --prod --release

alsit avatar May 12 '18 11:05 alsit

Please try upgrading to angularfire2@next, we support Angular 6. Note you will need to upgrade your firebase version too. If you still have an issue please open an new issue.

jamesdaniels avatar May 12 '18 22:05 jamesdaniels

@alsit did you get it fixed? I'm facing the same problem, tried upgrading, downgrading but nothing seems to work

guibas741 avatar Jul 25 '18 21:07 guibas741

Facing the same problem too 🙁.

david95thinkcode avatar Nov 19 '18 09:11 david95thinkcode