gpt4 book ai didi

android - 我们如何将 Admob 和 Firebase crashlytics 添加到 Android Studio Bumble Bee Build.Gradle 文件中

转载 作者:行者123 更新时间:2023-12-05 00:09:29 26 4
gpt4 key购买 nike

我们如何将 Admob 和 Firebase crashlytics 添加到 Android Studio Bumble Bee
之前的 build.gradle: 是这样的

buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// Add the following line:
classpath 'com.google.gms:google-services:4.3.10' // Google Services plugin
// Add the Crashlytics Gradle plugin
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'

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

task clean(type: Delete) {
delete rootProject.buildDir
}
然而现在的变化看起来像这些
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false



}

task clean(type: Delete) {
delete rootProject.buildDir
}
我尝试添加这些行
// Add the following line:
id 'com.google.gms:google-services' version '4.3.10' apply false
// Google Services plugin
// Add the Crashlytics Gradle plugin
id 'com.google.firebase:firebase-crashlytics-gradle' version '2.8.1' apply false
但它的错误是
Caused by: org.gradle.plugin.internal.InvalidPluginIdException: plugin id 'com.google.gms:google-services' is invalid: Plugin id contains invalid char ':' (only ASCII alphanumeric characters, '.', '_' and '-' characters are valid)
at org.gradle.plugin.use.internal.DefaultPluginId.validate(DefaultPluginId.java:65)
at org.gradle.plugin.use.internal.DefaultPluginId.of(DefaultPluginId.java:48)
at org.gradle.plugin.use.internal.PluginRequestCollector$PluginDependencySpecImpl.<init>(PluginRequestCollector.java:139)
at org.gradle.plugin.use.internal.PluginRequestCollector$PluginDependencySpecImpl.<init>(PluginRequestCollector.java:129)
at org.gradle.plugin.use.internal.PluginRequestCollector$PluginDependenciesSpecImpl.id(PluginRequestCollector.java:116)

最佳答案

添加 com.google.gms.google-servicescom.google.firebase.crashlytics像这样:

plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false


id 'com.google.gms.google-services' version '4.3.10' apply false // Google Services plugin
// Crashlytics Gradle plugin
id 'com.google.firebase.crashlytics' version '2.8.1' apply false
}

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

关于android - 我们如何将 Admob 和 Firebase crashlytics 添加到 Android Studio Bumble Bee Build.Gradle 文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71060055/

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