【发布时间】:2022-01-17 07:02:32
【问题描述】:
我一直在 Google Play 的广告应用内容中收到警告说“我们在您的应用中找到了广告 SDK”。在发布了许多尝试解决该问题的版本后,我发现原因是我的应用级构建 Gradle 文件中的这些行:
implementation ('com.google.android.gms:play-services-analytics-impl:18.0.1') {
exclude module: "play-services-ads"
exclude module: "play-services-ads-identifier"
exclude module: "play-services-measurement"
exclude module: "play-services-measurement-sdk"
}
有什么我可以排除的遗漏吗?
我运行了“gradlew -q dependencies app:dependencies command”,这些是库的传递依赖项:
+--- com.google.android.gms:play-services-analytics-impl:18.0.1
| +--- com.google.android.gms:play-services-base:18.0.1
| | +--- androidx.collection:collection:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | +--- androidx.core:core:1.2.0
| | | +--- androidx.annotation:annotation:1.1.0
| | | +--- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | | +--- androidx.lifecycle:lifecycle-common:2.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | +--- androidx.arch.core:core-common:2.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | \--- androidx.versionedparcelable:versionedparcelable:1.1.0
| | | +--- androidx.annotation:annotation:1.1.0
| | | \--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.fragment:fragment:1.0.0
| | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | +--- androidx.legacy:legacy-support-core-ui:1.0.0
| | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | +--- androidx.documentfile:documentfile:1.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.loader:loader:1.0.0
| | | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0
| | | | | | | +--- androidx.arch.core:core-runtime:2.0.0
| | | | | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
| | | | | | | | +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
| | | | | | | | +--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | | | | \--- androidx.arch.core:core-runtime:2.0.0 (*)
| | | | | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | \--- androidx.print:print:1.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | +--- androidx.customview:customview:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | \--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | +--- androidx.viewpager:viewpager:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.drawerlayout:drawerlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.interpolator:interpolator:1.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | | \--- androidx.interpolator:interpolator:1.0.0 (*)
| | | | +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | \--- androidx.core:core:1.0.0 -> 1.2.0 (*)
| | | | \--- androidx.cursoradapter:cursoradapter:1.0.0
| | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | +--- androidx.loader:loader:1.0.0 (*)
| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:18.0.0
| | | +--- androidx.collection:collection:1.0.0 (*)
| | | +--- androidx.core:core:1.2.0 (*)
| | | \--- androidx.fragment:fragment:1.0.0 (*)
| | \--- com.google.android.gms:play-services-tasks:18.0.1
| | \--- com.google.android.gms:play-services-basement:18.0.0 (*)
| +--- com.google.android.gms:play-services-basement:18.0.0 (*)
| \--- com.google.android.gms:play-services-stats:17.0.3
| +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| \--- com.google.android.gms:play-services-basement:18.0.0 (*)
【问题讨论】:
-
这和this是同一个问题吗?添加额外的排除是否删除了警告?您是否也将这些排除项添加到 Firebase 分析?
-
我发现这不是 firebase 库的问题,而是这个库的问题。我添加了排除项,但它没有删除警告。当我删除整个库时,版本的警告会消失,但我需要 CampaignTrackingReceiver 功能。
标签: android gradle google-play google-play-services ads