【问题标题】:Cannot connect to firebase无法连接到火力基地
【发布时间】:2021-11-22 07:14:05
【问题描述】:

我无法连接到 Firebase。我添加了所需的导入并删除了 jcenter() 但仍然无法正常工作。

无法解析 Android 应用模块的 Gradle 配置。解决 gradle 构建问题和/或重新同步。

我的摇篮

   dependencies {
    implementation platform('com.google.firebase:firebase-bom:28.4.1')
    implementation 'com.google.firebase:firebase-analytics-ktx'

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.github.QuadFlask:colorpicker:0.0.15'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation "com.airbnb.android:lottie:4.1.0"

}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: "androidx.navigation.safeargs"
buildscript {
    ext.kotlin_version = "1.3.72"
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.2'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
   
        classpath 'com.google.gms:google-services:4.3.10'
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }

    }
}

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

【问题讨论】:

    标签: android firebase gradle build.gradle


    【解决方案1】:

    我之前也遇到过同样的问题

        viewBinding.enabled = true
    

    如果您在项目中使用视图绑定,请评论此 lins 连接 firebase 后,您可以取消注释此行

    【讨论】:

    • 我已经完成了 firebase 网站上所说的一切,只是跳过了 android studio 指南的第一步,一切似乎都正常。无论如何感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 2016-09-17
    • 2022-11-01
    • 2018-10-27
    • 2017-10-19
    • 2016-09-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多