无法找到图书馆Google Play结算或附加功能

时间:2018-06-06 09:02:22

标签: android android-studio android-sdk-manager play-billing-library

可引用的链接,但对我不起作用:

我使用的是Android Studio 3.1.2

我正在尝试在此工作室中找到 Google Play结算库但未找到它。

另外我将库放入build.gradle(app):

implementation 'com.android.billingclient:billing:1.1'

Gradle Build Successfull但未在SDK Manager中显示Google Play结算库

请参阅下面的SDK Manager对话框屏幕截图:

enter image description here

以下是 build.gradle(app)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:0)

The reason why you can't find billing library in your sdk is because according to google official blog:

内按下图像时传递id
  

你会发现现在可以通过Maven存储库获得Play Billing Library,这就是你无法在你的sdk上找到它的原因。

所以现在开始添加计费库作为依赖项。然后继续前进。

implementation 'com.android.billingclient:billing:1.1'

谷歌也提供了编码样本,以帮助您入门:

https://codelabs.developers.google.com/codelabs/play-billing-codelab/#0

Github Link

此外,你也可以在这个答案中找到一些解释:

Why is the Google Play Billing Library not shown up in the SDK Manager?