3
votes

i started a brand new Project in Android Studio to try to add the billing library. but when i add the dependency implementation 'com.android.billingclient:billing:1.1' and sync gradle i get this errors:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.billingclient:billing:1.1. Open File Show Details Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.billingclient:billing:1.1. Open File Show Details Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.billingclient:billing:1.1. Open File Show Details Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.billingclient:billing:1.1. Open File Show Details Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.billingclient:billing:1.1. Open File Show Details

here is my gradle: enter image description here

2
Could you post the contents of your Gradle file as code instead of a picture? That way we can see your question/problem description and Gradle at the same time. - Abby

2 Answers

2
votes

Modify your project(not module) build.gradle file:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jcenter.bintray.com" } //add this line
    }
} 

and Sync project with Gradle files again.

0
votes

ok i have resolved it. i added this line maven { url "https://jcenter.bintray.com" } in my build.gradle (project) like this:

buildscript {
repositories {
    jcenter()
    google()
    maven { url "https://jcenter.bintray.com" }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'


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

}