Error mixing versions in the Gradle App with Firebase libraries

0

I'm trying to synchronize the libraries 'com.google.firebase:firebase-core:16.0.4' and 'com.google.firebase:firebase-database:16.0.4' in the Gradle but I skip the error of those libraries do not correspond to the others.

These Firebase libraries are the latest version and I am using 'com.android.support:appcompat-v7:28.0.0' with Android Studio 3.2 . I tried to change the com.android.support:appcompat-v7 verion but the error still appears.

Error: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.juancortesgarcia.myapplication"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 
        "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 
            'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-database:16.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso- 
    core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'

The library that gives an error is 'com.android.support:appcompat-v7:28.0.0'

    
asked by Juan 31.10.2018 в 10:47
source

1 answer

0

As you comment, these are the latest versions until today, October 2018:

implementation 'com.google.firebase:firebase-core:16.0.4' 
implementation 'com.google.firebase:firebase-database:16.0.4'

but I see you're using:

compileSdkVersion 28
targetSdkVersion 28

Currently there are several dependencies that are not yet ready to work correctly with this version of the SDK , so I suggest you change to:

compileSdkVersion 27
targetSdkVersion 27

and use the support library:

 implementation 'com.android.support:appcompat-v7:27.1.1'

This configuration I can assure you works without problems.

    
answered by 31.10.2018 в 17:07