无法解析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"


}

}

我在我的android工作室项目中有以下gradle代码,它仍然给我一个错误“无法解决com.android.billingclient:billing:dp-1”,为什么它不会同步?我应该附加更多的东西吗?

解决方法

com.android.billingclient:billing:dp-1在mavenCentral中不存在,但在jcenter中.您需要做的就是将jcenter()添加到存储库部分.
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
}

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...