更新firebase版本

时间:2018-02-02 02:52:47

标签: android firebase

我正在使用较旧版本的firebase,一切正常,然后我将其更新为11.8.0但是我在整个项目中都遇到了错误

  • '无法解析java类中的符号R'
  • 来自屏幕截图中的v26 \ values-v26.xml文件的错误:

xml file errors

这是我的gradle文件:

的build.gradle

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.google.firebase.udacity.friendlychat"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'

    // Displaying images
    compile 'com.github.bumptech.glide:glide:3.6.1'

    //firebase
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.firebaseui:firebase-ui-auth:3.2.1'
}
apply plugin: 'com.google.gms.google-services'

build.gradle(模块:应用)

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.google.firebase.udacity.friendlychat"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'

    // Displaying images
    compile 'com.github.bumptech.glide:glide:3.6.1'

    //firebase
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.firebaseui:firebase-ui-auth:3.2.1'
}
apply plugin: 'com.google.gms.google-services'

我重建项目并清理它但没有解决任何问题。

1 个答案:

答案 0 :(得分:2)

将您的gradle从版本25更新到26

 compileSdkVersion 25
 buildToolsVersion "25.0.2"

compileSdkVersion 26
buildToolsVersion "26.0.1"

和依赖

 compile 'com.android.support:design:26.0.0'
 compile 'com.android.support:appcompat-v7:26.0.0'