gpt4 book ai didi

android - 无法获得 google-services-4.3.3 - Firebase 实现

转载 作者:行者123 更新时间:2023-12-04 10:58:37 25 4
gpt4 key购买 nike

我是 Android Studio 的新手,正在尝试在我的项目中实现 Firebase,但在尝试实现时发生错误 "类路径 'com.google.gms:google-services:4.3.3'" .

我收到此错误:无法 GET google-services-4.3.2, 403 Forbidden 当我尝试同步 Gradle 时。

这是我的项目/build.gradle:

    buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
maven { url "https://dl.bintray.com/android/android-tools" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
// 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
}

我的应用程序/build.gradle :
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.xxxxxx.tabataworkout"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
testImplementation "android.arch.persistence.room:testing:$room_version"
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.android.support:design:27.1.1'
}

apply plugin: 'com.google.gms.google-services'

最佳答案

In your project build.gradle files:


 buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'


}
}
allprojects {
repositories {
maven { url "https://maven.google.com" }

google()
mavenCentral()
jcenter()


}
}

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

In your app build.gradle files:


//Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation 'com.google.firebase:firebase-perf:16.0.0'

...} apply plugin: "com.google.gms.google-services"

Databinding is set to true as well:


dataBinding {
enabled = true
}

关于android - 无法获得 google-services-4.3.3 - Firebase 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58995171/

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