Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can we add Admob and Firebase crashlytics to Android studio bumble bee Build.Gradle file

How can we add Admob and Firebase crashlytics to Android studio bumble bee

earlier the build.gradle: was some thing like this

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
}

However now the changes look like these

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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
}

I tried adding these lines

// 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

But it error is

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)

>Solution :

Add buildscript above plugins

buildscript {
  dependencies {
    // Add our classpath 
     classpath 'com.google.gms:google-services:4.3.10'
     classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' 
 }
}
 plugins {
      id 'com.android.application' version '7.1.0' apply false
      id 'com.android.library' version '7.1.0' apply false
}

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading