gpt4 book ai didi

android - 更新 firebase 版本后出现错误 "Cannot resolve symbol R"

转载 作者:行者123 更新时间:2023-11-29 16:45:34 30 4
gpt4 key购买 nike

我正在使用旧版本的 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'

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

最佳答案

将你的 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'

关于android - 更新 firebase 版本后出现错误 "Cannot resolve symbol R",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48575020/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com