1

The build is failing after i added cordova-plugin-firebase. Every time i get a different error. I noticed that the plugin is changing my google-service.json as well. The most error i am getting is the following:

 Execution failed for task ':app:fabricGenerateResourcesDebug'.
> Crashlytics Developer Tools error.
app:fabricGenerateResourcesDebug FAILED
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: 
null.
Check the Crashlytics plugin to make sure that the application has been 
added successfully!
Contact [email protected] for assistance.

I have no idea why is this tool needed and what has io fabric to do with it. I haven't installed or migrated anything from io fabric. here are my package.json dependencies:

"@angular/animations": "^8.1.2",
"@angular/common": "^7.2.2",
"@angular/core": "^7.2.2",
"@angular/forms": "^7.2.2",
"@angular/http": "^7.2.2",
"@angular/platform-browser": "^7.2.2",
"@angular/platform-browser-dynamic": "^7.2.2",
"@angular/router": "^7.2.2",
"@ionic-native/core": "^5.0.0",
"@ionic-native/fabric": "^5.12.0",
"@ionic-native/firebase": "^5.0.0",
"@ionic-native/social-sharing": "^5.11.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^4.1.0",
"@ionic/storage": "^2.2.0",
"angularfire2": "^5.2.1",
"cordova-android": "^8.0.0",
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.1.0",
"cordova-plugin-firebase": "^2.0.5",
"cordova-plugin-x-socialsharing": "^5.4.7",
"cordova-sqlite-storage": "^3.2.1",
"cordova-support-google-services": "^1.3.1",
"core-js": "^2.5.4",
"es6-promise-plugin": "^4.2.2",
"firebase": "^6.3.1",

*my app-level build gradle dependency:

apply plugin: 'com.android.application'

buildscript {
  repositories {
    mavenCentral()
    google()
    jcenter()
   }

  dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0'
   }
 }

 dependencies {
 implementation fileTree(dir: 'libs', include: '*.jar')
implementation 'com.google.firebase:firebase-core:17.0.0'
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: ":CordovaLib"))
implementation "com.google.android.gms:play-services-tagmanager:+"
implementation "com.google.firebase:firebase-core:+"
implementation "com.google.firebase:firebase-messaging:+"
implementation "com.google.firebase:firebase-config:+"
implementation "com.google.firebase:firebase-perf:+"
implementation "androidx.annotation:annotation:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
// SUB-PROJECT DEPENDENCIES END
}

*my project level build-gradle dependencies:

   dependencies {

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.android.tools.build:gradle:3.3.0'

    classpath 'com.google.gms:google-services:4.1.0' // google-services 
dependency from cordova-plugin-firebase

    classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from 
cordova-plugin-firebase
    }

project properties:

target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-android-firebase-gradle-release/promocat- 
cordova-android-firebase-gradle-release.gradle
cordova.gradle.include.2=cordova-plugin-firebase/promocat-build.gradle
cordova.system.library.1=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.2=com.google.firebase:firebase-core:+
cordova.system.library.3=com.google.firebase:firebase-messaging:+
cordova.system.library.4=com.google.firebase:firebase-config:+
cordova.system.library.5=com.google.firebase:firebase-perf:+
cordova.system.library.6=androidx.annotation:annotation:1.0.0
cordova.system.library.7=androidx.legacy:legacy-support-v4:1.0.0
cordova.gradle.include.3=phonegap-plugin-multidex/promocat-multidex.gradle

after building, the plugin is changing my google-service.json that i downloaded from firebase to this:

"project_info": {
"project_number": "123",
"firebase_url": "https://cordova-plugin-firebase.firebaseio.com",
"project_id": "cordova-plugin-firebase",
"storage_bucket": "cordova-plugin-firebase.appspot.com"
 },
"client": [
{
  "client_info": {
    "mobilesdk_app_id": "1:123:android:123",
    "android_client_info": {
      "package_name": "com.github.cordova_plugin_firebase"
    }
  },
  "oauth_client": [
    {
      "client_id": "123.apps.googleusercontent.com",
      "client_type": 3
    }
  ],
  "api_key": [
    {
      "current_key": "123"
    }
  ],
  "services": {
    "analytics_service": {
      "status": 1
    },
    "appinvite_service": {
      "status": 1,
      "other_platform_oauth_client": []
    },
    "ads_service": {
      "status": 2
    }
  }
}
],
"configuration_version": "1"
 } 
0

1 Answer 1

2

Apparently there is a problem with the original cordova-plugin-firebase plugin. I installed another plugin similar to it, and the issues have been resolved.

Here is the link to the new plugin: https://github.com/dpa99c/cordova-plugin-firebasex#readme

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.