gpt4 book ai didi

java - 如何修复 android.support 和 firebase 错误?

转载 作者:行者123 更新时间:2023-12-02 00:27:04 26 4
gpt4 key购买 nike

当我尝试使用此项目设置 Firebase 时发生此错误。搜索后...我找到了一个解决方案,之后同步和构建工作正常并且应用程序在我的设备上运行。

但问题是:

  1. 我不明白要使用哪一对版本的 android.support 和 firebase。
  2. 尽管该应用运行正常,但仍显示红色下划线。

感谢您的帮助。
build.gradle(project)

build.gradle(app)

AndroidManifest

build.gradle(应用程序)

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.collegeapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}

dependencies {
implementation 'com.google.firebase:firebase-analytics:15.0.0'
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'
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'

build.gradle(项目)

buildscript {
repositories {
google()
jcenter()

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

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

尝试使用 firebase-analtyics 的升级版本。

implementation 'com.google.firebase:firebase-analytics:16.0.0'

关于java - 如何修复 android.support 和 firebase 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58046759/

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