0

I know this kind of questions has been seen multiples times since a couple of weeks, when google release a new firebase version;

Many people seems to succeded to compile after some tweaks, but I can't get my app to compile in android.

I've spent hours searching for answer, but I'm stuck !

this is the error :

The library com.google.firebase:firebase-iid is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 19.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

I've even tried this https://github.com/arnesson/cordova-plugin-firebase/issues/1081#issuecomment-503041641 but it changed nothing (it seems that this script he use don't do anything)

this is my project.properties

# This file was originally created by the Android Tools, but is now
# used by cordova-android to manage the state of the various third party
# libraries used in your application

# This is the Library Module that contains the Cordova Library, this is not
# required when using an AAR

# This is the application project.  This is only required for Android Studio Gradle projects

# Project target.
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-plugin-badge/app-badge.gradle
cordova.system.library.1=com.android.support:support-v4:27.1.0
cordova.system.library.2=com.soundcloud.android:android-crop:1.0.0@aar
cordova.system.library.3=com.facebook.android:facebook-android-sdk:4.+
cordova.gradle.include.2=cordova-plugin-firebase/app-build.gradle
cordova.system.library.4=com.google.android.gms:play-services-tagmanager:+
cordova.system.library.5=com.google.firebase:firebase-core:16.0.8
cordova.system.library.6=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.7=com.google.firebase:firebase-config:16.4.1
cordova.system.library.8=com.google.firebase:firebase-perf:16.2.4
cordova.system.library.8=com.google.firebase:firebase-iid:17.1.1
cordova.system.library.9=com.google.android.gms:play-services-auth:11.8.0
cordova.system.library.10=com.google.android.gms:play-services-identity:11.8.0
cordova.gradle.include.3=cordova-plugin-local-notification/app-localnotification.gradle
cordova.system.library.12=com.android.support:appcompat-v7:23+
cordova.gradle.include.4=cordova-plugin-telerik-imagepicker/app-ignorelinterrors.gradle
cordova.gradle.include.5=cordova-plugin-telerik-imagepicker/app-androidtarget.gradle
cordova.gradle.include.6=cordova-support-google-services/app-build.gradle

android/build.gradle :

/* Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
        maven { url 'https://maven.fabric.io/public' } // Fabrics Maven repository from cordova-plugin-firebase
    }
    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.0.1'
        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
        // 
        // implementation "com.google.firebase:firebase-iid:17.1.1"
    }


}

allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
        google() // Google's Maven repository from cordova-plugin-firebase
    }
    //This replaces project.properties w.r.t. build settings
    project.ext {
      defaultBuildToolsVersion="28.0.1" //String
      defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
      defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
      defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

// com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true// i dont like this

any ideas ?

thanks !

F4Ke
  • 1,631
  • 1
  • 20
  • 49

1 Answers1

0

The order of your dependencies is important. Try setting firebase:firebase-iid:17.1.1 right after firebase-core.

Also, specify an exact version for tagmanager and add firebase auth dependency: cordova.system.library.15=com.google.android.gms:play-services-tagmanager:16.0.8 cordova.system.library.16=com.google.firebase:firebase-auth:16.2.0

Nikitah
  • 719
  • 5
  • 15