Ankit Rath
Ankit Rath

Reputation: 59

Failed to resolve: firebase-ads:15.0.1:15.0.0

I wanted to monetize my app using admob. Using the firebase in assistant tab

When i used the admob option available in firebase it asked me to add the following dependency 'com.google.firebase:firebase-ads:15.0.1:15.0.0' but after the gradle build it gave me this error Failed to resolve: firebase-ads-15.0.0 so i used 'com.google.firebase:firebase-ads:12.0.1' which works great but with this one i can't see the ads. These are my dependencies :

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.daimajia.easing:library:2.0@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    implementation 'com.google.android.gms:play-services:12.0.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.firebase:firebase-core:12.0.1'
    //implementation 'com.google.firebase:firebase-ads:12.0.1'
    //implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-ads:15.0.1:15.0.0'
}

This is my project level gradle file

 buildscript {
 repositories {
    google()
    jcenter()
 }
 dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    //classpath 'com.google.gms:google-services:4.0.1'
    classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.0'
    classpath 'com.google.gms:google-services:4.1.0'
    // 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
}

Upvotes: 1

Views: 834

Answers (2)

Sniffer
Sniffer

Reputation: 1595

Firebase core and ads compile version should same Try this version 16.0.4

It looks like this :

implementation com.google.firebase:firebase-core:16.0.4

implementation 'com.google.firebase:firebase-ads:16.0.4'

Upvotes: 1

jay shah
jay shah

Reputation: 300

change line :

       implementation 'com.google.firebase:firebase-ads:15.0.1:15.0.0'

to

       implementation 'com.google.firebase:firebase-ads:15.0.1'

Upvotes: 0

Related Questions