Cordova-plugin-firebase: cant build andoird version because of firebase plugin

Created on 24 May 2019  路  9Comments  路  Source: arnesson/cordova-plugin-firebase

I keep getting this error when i build android : first problem was caused by firebase plugin, then i found a solution(cordova-android-firebase-gradle-release). tried 15.+...didn't work :/

-error : https://i.imgur.com/s3mVcXY.png (ionic cordova build android)
-package.json :https://i.imgur.com/UsfuF2f.png

$ cordova -v
8.1.2 ([email protected])

$ ionic -v
3.20.1

Full package.json:

{
"name": "Test",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/app-availability": "^5.6.0",
"@ionic-native/call-number": "^4.20.0",
"@ionic-native/core": "~4.18.0",
"@ionic-native/file": "^5.6.0",
"@ionic-native/firebase": "^4.18.0",
"@ionic-native/geolocation": "^5.6.0",
"@ionic-native/in-app-browser": "^5.6.0",
"@ionic-native/keyboard": "^4.20.0",
"@ionic-native/launch-navigator": "~4.18.0",
"@ionic-native/media": "^4.20.0",
"@ionic-native/network": "^4.20.0",
"@ionic-native/social-sharing": "^4.20.0",
"@ionic-native/splash-screen": "~4.18.0",
"@ionic-native/sqlite": "^4.20.0",
"@ionic-native/sqlite-porter": "^4.20.0",
"@ionic-native/status-bar": "~4.18.0",
"@ionic/pro": "2.0.4",
"@ionic/storage": "^2.2.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"angularfire2": "^5.1.3",
"call-number": "1.0.1",
"cordova-android": "7.1.4",
"cordova-android-firebase-gradle-release": "^3.0.0",
"cordova-android-play-services-gradle-release": "^3.0.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-appavailability": "^0.4.2",
"cordova-plugin-cocoapod-support": "^1.6.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-dialogs": "2.0.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-firebase": "2.0.5",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-inappbrowser": "^3.0.0",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.4",
"cordova-sqlite-storage": "^3.2.0",
"es6-promise-plugin": "^4.2.2",
"ionic-angular": "3.9.3",
"ionicons": "3.0.0",
"leaflet": "^1.5.1",
"mx.ferreyra.callnumber": "0.0.2",
"promise-polyfill": "^8.1.0",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.5.2",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2",
"zone.js": "0.8.29"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.1",
"typescript": "~2.8"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-appavailability": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-geolocation": {},
"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": {},
"cordova-plugin-file": {},
"cordova-sqlite-storage": {},
"cordova-plugin-media": {},
"uk.co.workingedge.cordova.plugin.sqliteporter": {},
"cordova-plugin-network-information": {},
"mx.ferreyra.callnumber": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"GOOGLE_API_KEY_FOR_ANDROID": "dq5sdqs5d4q5sd45qsDD4",
"OKHTTP_VERSION": "3.12.0"
},
"call-number": {},
"cordova-android-play-services-gradle-release": {
"PLAY_SERVICES_VERSION": "16.0.4"
},
"cordova-android-firebase-gradle-release": {
"FIREBASE_VERSION": "16.0.4"
},
"cordova-plugin-firebase": {}
},
"platforms": [
"android"
]
}
}

Plugins config.xml:






























Most helpful comment

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/Users/xxx/.nvm/versions/node/v10.10.0/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.0
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 19 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.10.0 (/Users/xxx/.nvm/versions/node/v10.10.0/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.2 Build version 10E125

I used Android Studio to build, not sure how to check.

Thanks, the solution for me was to upgrade from android 6.4.0 to android 7.1.4

All 9 comments

Try to instal the plugin with this:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

I'm facing the same issue.. I've tried:

but nothing help and I'm getting:

:preDebugBuild FAILED
3 actionable tasks: 1 executed, 2 up-to-date
FAILURE: Build failed with an exception.

  • What went wrong:
    1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

Here is my Info:

   ionic (Ionic CLI) : 4.2.1 (C:\Users\moshi\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework   : ionic1 1.3.3
   @ionic/v1-toolkit : 1.0.12
   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : android 6.4.0
   npm               : 6.4.1
   OS                : Windows 10

Please help

This worked for me:

cordova plugin remove cordova-plugin-firebase
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
ionic cordova platform remove android
ionic cordova platform add android
ionic cordova build android

This worked for me:

cordova plugin remove cordova-plugin-firebase
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
ionic cordova platform remove android
ionic cordova platform add android
ionic cordova build android

what is your android build version? can you please share your "ionic info"?
Thanks

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/Users/xxx/.nvm/versions/node/v10.10.0/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.0
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 19 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.10.0 (/Users/xxx/.nvm/versions/node/v10.10.0/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.2 Build version 10E125

I used Android Studio to build, not sure how to check.

Try this (This Plugin is not dependent on any other plugin)..
cordova platform rm android
cordova plugin remove cordova-plugin-firebase
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
cordova platform add android
cordova build android

Try to instal the plugin with this:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue

FYI: the above version still has the BIG BUG which removes the whole Android platform when uninstalling the plugin!!! Remove this line from plugin.xml:

<resource-file src="src/android/google-services.json" target="."/>

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/Users/xxx/.nvm/versions/node/v10.10.0/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.0
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 19 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.10.0 (/Users/xxx/.nvm/versions/node/v10.10.0/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.2 Build version 10E125

I used Android Studio to build, not sure how to check.

Thanks, the solution for me was to upgrade from android 6.4.0 to android 7.1.4

After adding plugin from git i got this error please help me out
Install the Firebase plugin: 'ionic cordova plugin add cordova-plugin-firebase'
main.js:1 Error getting token plugin_not_installed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthitachi picture matthitachi  路  5Comments

michaelreiser picture michaelreiser  路  5Comments

arunkatariaoodles picture arunkatariaoodles  路  4Comments

ghost picture ghost  路  3Comments

rolinger picture rolinger  路  3Comments