sodiumnitrat sodiumnitrat - 30 days ago 7
Android Question

Failed to resolve com.android.billingclient:billing:dp-1

project(":android") {
apply plugin: "android"
apply plugin: "com.android.application"

configurations { natives }

dependencies {
compile project(":core")
compile "com.android.billingclient:billing:dp-1"
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
compile "com.google.android.gms:play-services-ads:11.0.0"
compile "com.android.billingclient:billing:dp-1"


}


}

i have a following gradle code in my android studio project and it still gives me an error "Failed to resolve com.android.billingclient:billing:dp-1", why it won't sync? Should i attach something more?

EDIT:
Maybe it's silly, but I've found a solution:
com.android.billingclient:billing:dp-1 is not present in mavenCentral but in jcenter. All you need to do is to add jcenter() to the repositories section.

allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '1.0'
ext {
appName = "FidgetSpinner"
gdxVersion = '1.9.6'
roboVMVersion = '2.3.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}

repositories {
mavenLocal()
mavenCentral()
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "http://oss.sonatype.org/content/repositories/releases/" }
jcenter() <<<<<<------------ ADD THIS LINE TO MAKE IT WORK
}


}

Answer Source

com.android.billingclient:billing:dp-1 is not present in mavenCentral but in jcenter. All you need to do is to add jcenter() to the repositories section.

    allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '1.0'
ext {
    appName = "FidgetSpinner"
    gdxVersion = '1.9.6'
    roboVMVersion = '2.3.0'
    box2DLightsVersion = '1.4'
    ashleyVersion = '1.7.0'
    aiVersion = '1.8.0'
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "http://oss.sonatype.org/content/repositories/releases/" }
    jcenter()        <<<<<<------------ ADD THIS LINE TO MAKE IT WORK
}