【问题标题】:Plugin [id: 'com.google.gms.google-services'] was not found未找到插件 [id: 'com.google.gms.google-services']
【发布时间】:2021-12-22 22:32:24
【问题描述】:

当我尝试将云 Firestore SDK 添加到您的应用时,它会显示一个错误。

错误: enter image description here

bulid.gradle 项目的图片: enter image description here

project.setting 的图片: enter image description here

请帮帮我...

plugins {

    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.gms.google-services'
}

android {
    compileSdk 31

    defaultConfig {
        applicationId "com.example.faltu3"
        minSdk 16
        targetSdk 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.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
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.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 'com.google.firebase:firebase-firestore:24.0.0'
    implementation 'com.android.support:support-annotations:28.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

【问题讨论】:

    标签: android firebase google-cloud-firestore android-gradle-plugin google-play-services


    【解决方案1】:

    您需要在 build.gradle(projectname) 中添加以下依赖项 " 类路径 'com.google.gms:google-services:4.3.10' "

    以及 build.gradle(:app) 中的“应用插件:'com.google.gms.google-services'”

    【讨论】:

      猜你喜欢
      • 2017-02-14
      • 1970-01-01
      • 2020-02-24
      • 2022-09-20
      • 2021-02-27
      • 2020-12-08
      • 2018-04-19
      • 1970-01-01
      相关资源
      最近更新 更多