0

So this is a little new to me, I am using adblock project and showing my website from webviewer but i want to not show my website's ads into it, so i used adblock project for the same. But somehow i am getting this weird error of not founding

com.google.android.gms:play-services-ads:15.0.0

    Failed to resolve: com.google.android.gms:play-services-ads:15.0.0
    Install Repository and sync project
    Show in File
    Show in Project Structure dialog

After i clicked on Install Repository and sync project the SDK manager says

Could not find dependency "com.google.android.gms:play-services-ads:15.0.0"

Configs: In build.gradle(project)

buildscript {
  repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven {
      url "https://maven.google.com"
    }

And in build.gradle(Module:libadblockerplus-android-webviewapp)

 dependencies {
        compile project(':libadblockplus-android-settings')
        compile project(':libadblockplus-android-webview')
        compile 'com.android.support:appcompat-v7:21.0.3'
        compile 'com.google.android.gms:play-services-ads:15.0.0'
    }

2 Answers2

0

adding

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

to the other repositories block in your build.gradle file. Fixed the issue. Thanks @stkent

0

You should add

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

to the other repositories block in your build.gradle file.

From your posted snippet, it appears you have already added it to the buildscript block's list of repositories. However, those repositories are only used to search for dependencies for the building of your application. See this SO question for more discussion on the difference between the repositories and buildscript.repositories blocks.

stkent
  • 19,772
  • 14
  • 85
  • 111