Android - Error using in app billing

248 views Asked by At

I tried following this link to add in app billing to my app.

I added this to my build.gradle

dependencies {
...
compile 'com.android.billingclient:billing:dp-1'
}

but I get this error when i build->clean project

Error:A problem occurred configuring project ':android'.
> Could not resolve all dependencies for configuration 
':android:_debugApkCopy'.
> Could not find com.android.billingclient:billing:dp-1.
 Required by:
     Mygame:android:1.0

What am i missing? I can't find any useful information when googling.I am using libgdx and Android Studios.

1

There are 1 answers

0
AAryan On

com.android.billingclient:billing:dp-1 is available in jcenter repository so add jcenter in repositories list of your root build.gradle file.

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

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

  repositories {
      mavenLocal()
      mavenCentral()
      maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
      maven { url "https://oss.sonatype.org/content/repositories/releases/" }
      maven { url "https://maven.google.com/"}
      jcenter()   // <--  Add this 

  }
}