0

我尝试按照此链接将应用计费添加到我的应用中。

我将此添加到我的 build.gradle

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

但是当我 build->clean 项目时出现此错误

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

我错过了什么?谷歌搜索时找不到任何有用的信息。我正在使用 libgdx 和 Android Studios。

4

1 回答 1

0

com.android.billingclient:billing:dp-1在 jcenter 存储库中可用,因此添加jcenterbuild.gradle文件的存储库列表。

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 

  }
}
于 2017-09-02T19:50:36.810 回答