繁体   English   中英

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

[英]how to fix android.support and firebase error?

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

但问题是:

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

谢谢您的帮助。
build.gradle(项目)

构建.gradle(应用程序)

AndroidManifest

构建.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'
classpath 'com.google.gms:google-services:4.2.0'

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

我希望它有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM