【问题标题】:Google Play Services Library and API 18 (AppOpsManager not found)Google Play 服务库和 API 18(未找到 AppOpsManager)
【发布时间】:2015-09-11 09:45:57
【问题描述】:

我使用 Google Play 服务并选择性地在 Gradle 中编译 Admob 和 Analytics,如下所示:

dependencies {
    compile 'com.google.android.gms:play-services-ads:+' 
    compile 'com.google.android.gms:play-services-analytics:+'
    ...
}

它不适用于 API 18 设备。它因错误日志而崩溃:

Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza

然后我将我的设备升级到 API 19,它工作正常。所以我猜最新的 Google Play Service Library 7.8.0 引用了 AppOpsManager,但根据 AppOpsManager (link) 的文档,它仅在 API 19 之后可用。

有什么提示可以让它与较低 API 级别的设备一起工作吗?

(我必须对 Google Play 服务使用选择性编译以避免“dex-index-overflow”,并且我使用的 Dexguard 不适用于启用了多 dex 的 apk。)

【问题讨论】:

  • 我有同样的问题。使用带有分析和应用索引的谷歌播放服务“7.8.0”。

标签: android google-play-services


【解决方案1】:

Admob 和 Analytics 使用 API 9

试试这个:
编译 'com.google.android.gms:play-services-ads:7.8.0'

【讨论】:

    猜你喜欢
    • 2016-10-30
    • 1970-01-01
    • 1970-01-01
    • 2014-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多