簡體   English   中英

無法解析com.android.billingclient:billing:1.1

[英]Could not resolve com.android.billingclient:billing:1.1

我在Android Studio中啟動了一個全新的項目,嘗試添加結算庫。 但是當我添加依賴項implementation 'com.android.billingclient:billing:1.1'和sync gradle時,我得到以下錯誤:

無法解析':app @ debug / compileClasspath'的依賴關系:無法解析com.android.billingclient:billing:1.1。 打開文件顯示詳細信息無法解析':app @ debugAndroidTest / compileClasspath'的依賴關系:無法解析com.android.billingclient:billing:1.1。 打開文件顯示詳細信息無法解析':app @ debugUnitTest / compileClasspath'的依賴關系:無法解析com.android.billingclient:billing:1.1。 打開文件顯示詳細信息無法解析':app @ release / compileClasspath'的依賴關系:無法解析com.android.billingclient:billing:1.1。 打開文件顯示詳細信息無法解析':app @ releaseUnitTest / compileClasspath'的依賴關系:無法解析com.android.billingclient:billing:1.1。 打開文件顯示細節

這是我的傻瓜: 在這里輸入圖像描述

修改你的項目(而不是模塊) build.gradle文件:

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

並再次使用Gradle文件同步項目

好的,我已經解決了。 我在build.gradle(項目)中添加了這行maven { url "https://jcenter.bintray.com" } ,如下所示:

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
}

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM