Google 播放:我们在您的应用程序中找到了广告 SDK

Google Play: We found Ad SDKs in your application

Google 在其 Google Play 开发者控制台的定价和分发页面上添加了一个新选项,要求发布商声明他们是否有广告。我们的应用程序没有广告,但我们被标记为拥有 AdMob SDK。

We detected Ad SDKs in one or more of your active APKs:

version: XXXXX, sdk: AdMob

If your app is serving ads, please change your ads declaration to 'Yes'. Failure to accurately declare the presence of ads is a policy violation and may result in your app's removal from Google Play. You can visit our Help Center to learn more.

根据我们的 Gradle 文件,我们没有 AdMob:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'me.dm7.barcodescanner:zxing:1.7.2'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
}

是什么导致了这种依赖性的出现?我怎样才能摆脱它?

您可以 运行 gradlew -q dependencies app:dependencies 查看每个配置的依赖项(包括所有传递依赖项)。

也可以指定单个配置,比如用--configuration releaseCompile

在您的情况下,您会发现 Google Play 服务包含对 AdMob 的传递依赖性。

您可以通过使用 only individual components of Play Services(例如 play-services-location)而不是整个 Play 服务来缓解这种情况。但是,您可能会发现您使用的其中一个组件仍然依赖于 AdMob。例如,play-services-analytics 的 8.1.0 版具有对 play-services-ads 的传递依赖性,即 AdMob SDK。

来自 Google Play 支持聊天 我在 Google Play Console 中被告知 "No",尽管检测到了。

我已按照以下步骤操作并删除了通知

首先检查哪个 gradle 包包含“play-services-ads-identifier”包依赖项。您可以像下面这样添加更新这些包:

implementation('com.google.firebase:firebase-analytics') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}

其次,如果您的 gradle 中有包含广告的分析包,那么您必须执行这些步骤,或者您可以跳过它。您可以在应用的清单标签中添加以下标签。

<meta-data android:name="google_analytics_adid_collection_enabled"
        android:value="false" />

希望对你也有帮助。

根据 Google play console 中的说明,您可以将答案保留为“否”

我已经通过这些步骤解决了

  1. 首先找到包含 play-services-ads-identifier 的 android 个依赖项列表。通过 Android Studio Gradle 面板 Click on Gradle tab on the right side

Task will print all dependencies including internal packages example included in below image

  1. 之后排除 play-services-ads-identifier。在我的例子中,我有两个依赖项,其中包含 play-services-ads.
  • 第一个依赖项:
implementation('com.google.firebase:firebase-core:19.0.2') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}
  • 第二依赖:
implementation('com.google.firebase:firebase-analytics') {
    exclude module: "play-services-ads-identifier"
    exclude module: "play-services-measurement"
    exclude module: "play-services-measurement-sdk"
}

它解决了我的问题。