首页 > 解决方案 > Google 开发者控制台中的“我们检测到您的应用正在使用旧版本的 Google Play 开发者 API”警告是什么?

问题描述

我们没有明确使用任何 Google Play Developer API,但我们收到以下警告:

在此处输入图像描述

这与https://developer.android.com/google/play/billing/billing_library_releases_notes有关吗?

我们目前正在使用Google Play Billing Library 1.2.2 Release (2019-03-07)

我们不打算迁移Google Play 计费库 2.0.1 版本 (2019-06-06),因为这将是大量工作而收效甚微。

购买必须在三天内确认

但这只是我的猜测——Google Play Billing 库与 Google Play Developer API 相关。它们可能相互关联,也可能不相互关联。

“我们检测到您的应用正在使用旧版本的 Google Play 开发者 API”是什么意思?

以下是我们的全部依赖项。知道是什么导致了这个警告吗?

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])


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


    implementation 'androidx.multidex:multidex:2.0.1'


    def lifecycle_version = '2.0.0-beta01'
    // ViewModel and LiveData
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"


    // alternately - if using Java8, use the following instead of compiler
    implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"


    def room_version = '2.1.0'
    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:$room_version"

    def work_version = "2.1.0"
    implementation "androidx.work:work-runtime:$work_version"

    // https://github.com/yccheok/SmoothProgressBar
    implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'

    // For Google Drive REST API - https://github.com/gsuitedevs/android-samples/blob/master/drive/deprecation/app/build.gradle
    implementation('com.google.http-client:google-http-client-gson:1.26.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation('com.google.api-client:google-api-client-android:1.26.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
        exclude group: 'org.apache.httpcomponents'
    }

    implementation 'com.google.firebase:firebase-messaging:19.0.1'

    implementation 'com.google.android.gms:play-services-auth:17.0.0'

    implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
    implementation 'androidx.preference:preference:1.1.0-beta01'
    implementation 'com.google.android.material:material:1.1.0-alpha07'

    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation 'com.github.yccheok:AndroidDraw:0.18'
    implementation 'com.github.yccheok:SectionedRecyclerViewAdapter:0.4'
    implementation 'com.github.yccheok:CalendarView:1.10'

    implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'

    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

    implementation 'com.github.yccheok:PhotoView:0.1'

    implementation 'com.github.yccheok:Matisse:1.6'

    implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1'

    // https://github.com/romandanylyk/PageIndicatorView
    implementation 'com.romandanylyk:pageindicatorview:1.0.2@aar'

    implementation 'me.zhanghai.android.materialratingbar:library:1.3.2'

    testImplementation 'junit:junit:4.12'

    testImplementation "org.robolectric:robolectric:4.2.1"
    testImplementation 'org.mockito:mockito-core:2.23.0'
    testImplementation 'org.powermock:powermock-core:2.0.0-RC.4'
    testImplementation 'org.powermock:powermock-module-junit4:2.0.0-RC.4'
    testImplementation 'org.powermock:powermock-api-mockito2:2.0.0-RC.4'

    androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'
}

对于项目级别的依赖,它是

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.2'
    classpath 'com.google.gms:google-services:4.2.0'

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

标签: androidgoogle-api-java-clientgoogle-developers-console

解决方案


问题是您在 Google Cloud Platform 上的项目使用的是旧版本的 Developer Web API。当您有意/无意地从开发者设置中的 Google Play 控制台的API 访问部分启用开发者服务时,它会自动为您设置。

用于订阅和购买的 Web API 实际上是 Android Developer API 的一部分:

Google Play Developer API 允许您执行许多发布和应用程序管理任务。它包括两个组件:

订阅和应用内购买 API 让您可以管理应用内购买和订阅。
Publishing API 允许您上传和发布应用程序,以及执行其他与发布相关的任务。

没有在您的应用程序中使用上述 API,此 API 用于管理而非实际购买。您正在使用具有不同版本的 SDK,因此无需升级。但是,此 API 是在您的 GCP 项目中设置的。

要查找 GCP 上的哪个项目与您的 Play 管理中心相关联,请访问此链接: https: //play.google.com/apps/publish/#ApiAccessPlace

在此处输入图像描述

您只需要转到 GCP,找到您的项目,找到 Google Android Developer API 并在那里更改版本。或者,如果您不使用 API,您可以禁用它。

例如,我的 GCP 项目自动命名为Google Play Android Developer,因此您的可能与您的项目相同。

我在控制台上看不到选项,可能是因为他们为新项目删除了它,但如果您的项目已经在使用旧版本,您可能也会在那里收到警告。

在此处输入图像描述


推荐阅读