【问题标题】:Android Firebase: Could not parseAndroid Firebase:无法解析
【发布时间】:2021-07-30 07:22:06
【问题描述】:

我尝试将 Firebase 与我的应用连接,但出现此错误

这是我的 build.gradle(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.0"

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

allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
    }
}

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

这是我的 build.gradle(模块)

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.android.application"
        minSdkVersion 16
        targetSdkVersion 30
        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 JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:2.0.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

我尝试从这个答案Android app does not connect to Firebase 中检查 .gzips,但没有找到任何 .gzips 文件

怎么办……

【问题讨论】:

    标签: android firebase android-studio


    【解决方案1】:

    好吧,我在发布问题几分钟后就得到了答案,我想删除它,但我保留了它,因为其他人可能会遇到这个问题来寻求答案,所以我开始了。

    在文件/项目结构/项目中,将 Android Gradle 插件版本更改为 4.1.3,将 Gradle 版本更改为 6.5。

    【讨论】:

      【解决方案2】:

      刚刚降级了你的 Gradle 插件版本。在文件/项目结构/项目中,将 Android Gradle 插件版本更改为 4.2.2

      Here is the example it worked for me ?

      【讨论】:

        猜你喜欢
        • 2017-07-08
        • 1970-01-01
        • 1970-01-01
        • 2016-10-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-02-26
        • 2020-09-12
        相关资源
        最近更新 更多