【发布时间】:2017-12-11 18:56:26
【问题描述】:
我刚刚升级到最新的 google play 服务 (11.6.0)。当我使用 proguard 构建时,我现在收到以下警告:
Warning: com.google.android.gms.gcm.zza: can't find referenced method 'android.app.NotificationChannel getNotificationChannel(java.lang.String)' in library class android.app.NotificationManager
Warning: com.google.android.gms.gcm.zza: can't find referenced class android.app.NotificationChannel
Warning: com.google.android.gms.gcm.zza: can't find referenced class android.app.NotificationChannel
Warning: com.google.android.gms.gcm.zza: can't find referenced method 'void createNotificationChannel(android.app.NotificationChannel)' in library class android.app.NotificationManager
Warning: com.google.android.gms.gcm.zza: can't find referenced method 'android.app.Notification$Builder setChannelId(java.lang.String)' in library class android.app.Notification$Builder
Warning: com.google.android.gms.internal.zzbga: can't find referenced method 'boolean isInstantApp()' in library class android.content.pm.PackageManager
Warning: com.google.android.gms.internal.zzbgb: can't find referenced method 'boolean isInstantApp(java.lang.String)' in library class android.content.pm.PackageManager
为什么我会看到这个?我认为 GMS 处理了它自己的 Proguard 规则。来自文档link:
注意:ProGuard 指令包含在 Play 服务客户端中 库以保留所需的类。 Android 插件 Gradle 自动在 AAR 中附加 ProGuard 配置文件 (Android ARchive) 打包并将该包附加到您的 ProGuard 配置。在项目创建过程中,Android Studio 会自动 创建 ProGuard 配置文件和 build.gradle 属性 供 ProGuard 使用。要将 ProGuard 与 Android Studio 一起使用,您必须启用 build.gradle buildTypes 中的 ProGuard 设置。更多 信息,请参阅 ProGuard 指南。
【问题讨论】:
标签: android google-play-services