14

I have tried to integrate Admob Ads. The very first step is to add these statements to build.gradle.

Project Level

dependencies {
        classpath 'com.google.gms:google-services:3.0.0'
    }

Module level:

dependencies {
            compile 'com.google.firebase:firebase-ads:9.2.0'
        }

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

But when synced getting

 Failed to resolve: com.google.firebase:firebase-ads:9.2.0

How can I integrate these advertisements?

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117
MduSenthil
  • 2,019
  • 3
  • 18
  • 39
  • Follow this [http://stackoverflow.com/questions/37310188/failed-to-resolve-com-google-firebasefirebase-core9-0-0](http://stackoverflow.com/questions/37310188/failed-to-resolve-com-google-firebasefirebase-core9-0-0) but enable Google Repo 29 – javaman Jul 03 '16 at 20:53

5 Answers5

11

You have to update your Google Play Service to the last version, currently is 31, also your Google Repository must be the last too, now is 29.

icastell
  • 3,495
  • 1
  • 19
  • 27
2

I just integrated Firebase analytics as well. I had the same problem though! What seems to fix the problem is changing compile 'com.google.firebase:firebase-core:9.2.0' to compile 'com.google.firebase:firebase-core:9.0.2'. Basically the 9.2.0 should be 9.0.2. I was using this tutorial, and it said to use 9.2.0. I am assuming either the tutorial has a typo or something needs to be updated. This will work though! :)

Michael Jones
  • 2,222
  • 18
  • 32
1

Looks like you have a typo with the version.


Replace compile 'com.google.firebase:firebase-ads:9.2.0' with compile 'com.google.firebase:firebase-ads:9.0.2'


Update: 9.2.0 is a valid version. You might be able to use 9.2.0, but you have to update Google Services from the SDK Manager. If that doesn't work, then stick with 9.0.2 until we find something.

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117
  • 1
    Version 9.2.0 was just released yesterday. – Frank van Puffelen Jun 30 '16 at 14:22
  • 2
    Weird... But firebase still tells us to use 9.0.2 in the quickstart, so maybe stick to 9.0.2 until it has official updates. – Ali Bdeir Jun 30 '16 at 14:30
  • 1
    I just checked the docs and they say 9.2.0: https://firebase.google.com/docs/android/setup#add_the_sdk – Frank van Puffelen Jun 30 '16 at 14:44
  • Not typo. I have copied this version from Google setup instructions. But it is not working. Changed it to 9.0.2 and it worked. – MduSenthil Jul 01 '16 at 07:03
  • This is not a typo mistake, you have to update to the last version of the Google Play Services. See my answer: http://stackoverflow.com/a/38139399/1143172 – icastell Jul 01 '16 at 07:37
  • @icastell indeed, it isn't a typo, but it solved his error. If he wants to update, he needs to create a separate question claiming he can't update his FB version. – Ali Bdeir Jul 01 '16 at 11:38
  • 1
    @AbAppletic I see your point. Yours is a possible solution but I think is better to integrate the last version, indeed the question is about 9.2.0 version not 9.0.2 and the problem is that the partner doesn't have the last version of Google Play Service. – icastell Jul 01 '16 at 12:16
  • yes this is mentioned in official google setup documentation – Erum Jul 03 '16 at 15:29
1

Updating google services in SDK Manager helped me.

m43x
  • 225
  • 1
  • 3
  • 11
0

Update all your google services version from 9.0.2 to 9.2.0.