Skip to content Skip to sidebar Skip to footer

Gradle Project Sync Failing After Google Announced The New Sdk Versioning System

I am getting the following error: Cannot change dependencies of configuration ':app:api' after it has been included in dependency resolution. Updated: I am able to build using com

Solution 1:

managed to build against Play Services & Firebase 15.0.0with data-binding enabled ...my dependencies now look about alike this and it builds again, without any Cannot change dependencies of configuration complaints:

buildscript {

    dependencies {

        classpath "com.android.tools.build:gradle:3.1.2"// do not update, because 3.3.1 appears broken// classpath "com.google.gms:google-services:3.2.1"// meanwhile, there is version 4.0.2 available
        classpath "com.google.gms:google-services:4.0.2"
    }
}

one has to reference all the libraries individually. just referencing com.google.android.gms:play‐services and/or com.google.firebase:firebase-core does not work anymore since 15.0.0.

android {

    dependencies {

        // Play Services 15.0.0
        implementation "com.google.android.gms:play-services-base:15.0.1"
        implementation "com.google.android.gms:play-services-auth:15.0.1"
        implementation "com.google.android.gms:play-services-identity:15.0.1"// Firebase 15.0.0
        implementation "com.google.firebase:firebase-core:15.0.2"
        implementation "com.google.firebase:firebase-database:15.0.1"
        implementation "com.google.firebase:firebase-firestore:16.0.0"
        implementation "com.google.firebase:firebase-storage:15.0.2"
        implementation "com.google.firebase:firebase-crash:15.0.2"
        implementation "com.google.firebase:firebase-auth:15.1.0"
        implementation "com.google.firebase:firebase-messaging:15.0.2"
        implementation "com.google.firebase:firebase-config:15.0.2"
        implementation "com.google.firebase:firebase-invites:15.0.1"
        implementation "com.google.firebase:firebase-ads:15.0.1"
        implementation "com.google.firebase:firebase-appindexing:15.0.1"
        implementation "com.google.firebase:firebase-perf:15.2.0"
        implementation "com.google.firebase:firebase-functions:15.0.0"
    }
}

apply plugin: 'com.google.gms.google-services'

also had to edit the Manifest.xml to fix the support library:

<application><meta-dataandroid:name="android.support.VERSION"android:value="27.1.1"tools:replace="android:value"/>

</application

Solution 2:

The issue with data binding and the 3.3.0 version of the google-services plugin has been reported here: https://issuetracker.google.com/issues/79122163

As of today, the bug is in the "assigned" state.

Solution 3:

UPDATE I could compile also with

dataBinding.enabled false

In android configuration and version 3.3.0

ORIGINAL

Same problem here with google-services:3.3.0, which is the last version, but according to docs version 3.2.1 should be used. I've been able to compile with the following

 ext {
    kotlin_version = '1.2.41'
    firebaseCore = '15.0.2'
    authentication = '15.1.0'
    cloudFirestore = '16.0.0'
    cloudStorage = '15.0.2'
    crashlitics = '2.9.1'
    googleServices = '15.0.0'
    supportLibrary = '27.1.1'
    facebookSdkVersion = '4.31.0'
    twitterSdkVersion = '3.1.1'
    firebaseUI = '3.3.1'
}
 dependencies {

    classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    classpath 'com.google.gms:google-services:3.2.1'
}

Solution 4:

This issue seems to have been resolved by using the new google-services release (4.0.1 as of today). Below is the relevant versions that will resolve the stated issue:

In your project build.gradle files:

dependencies { 
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1' }

In your app build.gradle files:

//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation 'com.google.firebase:firebase-perf:16.0.0'

...} apply plugin: "com.google.gms.google-services"

Databinding is set to true as well:

dataBinding {
    enabled = true
}

Android Studio version: 3.1.2

Thank you all for providing various ways you can get around the problem, such as the answer by @Kyle and the medium post link that shows you how to use firebase without google services.

Solution 5:

Just downgrade your GooglePlay services dependency to 3.2.1 :)

classpath 'com.google.gms:google-services:3.2.1'

Post a Comment for "Gradle Project Sync Failing After Google Announced The New Sdk Versioning System"