Android 应用程序Gradle,如何在使用Firebase core时修复错误?

Android 应用程序Gradle,如何在使用Firebase core时修复错误?,android,firebase,gradle,android-gradle-plugin,build.gradle,Android,Firebase,Gradle,Android Gradle Plugin,Build.gradle,以下是build.gradle-app文件: apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "xxx.xxx.xxx" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "

以下是build.gradle-app文件:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "xxx.xxx.xxx"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.1.0"
        testInstrumentationRunner 
        "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 
            'proguard-rules.pro'
        }
    }
}

dependencies {
    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'

    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-iid:17.0.3'
    implementation 'com.google.firebase:firebase-analytics-impl:16.1.1'
    implementation 'com.google.firebase:firebase-analytics:16.0.4'

    compile 'com.android.support:support-annotations:27.1.1'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.github.chrisbanes:PhotoView:2.1.3'
    compile 'com.google.code.gson:gson:2.8.1'
    compile 'com.squareup.retrofit2:retrofit:2.4.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.android.support:animated-vector-drawable:26.1.0'
    compile 'com.android.support:gridlayout-v7:26.1.0'
    compile 'com.squareup.okhttp3:okhttp:3.11.0'
    compile 'com.felipecsl:gifimageview:2.1.0'
    compile 'commons-io:commons-io:2.4'

    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

}
apply plugin: 'com.google.gms.google-services'
这就是构建梯度:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'com.android.tools.build:gradle:3.3.0-alpha05'
    }
}

allprojects {
    repositories {
        maven {
            url 'https://maven.google.com'
            name 'Google'
        }
        maven {
            url "https://jitpack.io"
        }
        mavenLocal()
        mavenCentral()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
我想创建一个firebase身份验证,在设置页面上显示使用firebase-core-16.0.1。当出现错误时,我已按照建议的说明添加firebase analytics


请帮助我更正gradle上的错误代码,或者我可以知道我可以使用的google服务或依赖版本的用法。

要解决此问题,请更改以下代码行:

classpath 'com.android.tools.build:gradle:3.3.0-alpha05'

请同时删除以下代码行:

implementation 'com.google.firebase:firebase-iid:17.0.3'
implementation 'com.google.firebase:firebase-analytics-impl:16.1.1'

对所有
Firebase
dependencies使用相同的版本,直到不起作用,即使我只使用Firebase core 16.0.4。似乎建议添加firebase analytics,但我仍然错误删除
implementation'com.google.firebase:firebase analytics impl:16.1.1'
implementation'com.google.firebase:firebase analytics:16.0.4'
,然后再试一次!你试过我上面的解决方案了吗?我试过了,但仍然是个错误。Android Studio版本是否影响Gradle中的库使用?仍然是一个错误,这是什么?是的,应该是兼容的。在这一行中,实现'com.google.firebase:firebase-core:16.0.4'。我将尝试更新android studio firstOk并随时通知我。
implementation 'com.google.firebase:firebase-iid:17.0.3'
implementation 'com.google.firebase:firebase-analytics-impl:16.1.1'