Android 为什么Google Play服务需要这些proguard规则
我刚刚升级到最新的google play服务(11.6.0)。当我使用proguard构建时,我现在收到以下警告:Android 为什么Google Play服务需要这些proguard规则,android,google-play-services,Android,Google Play Services,我刚刚升级到最新的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.NotificationManage
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
为什么我会看到这个?我以为通用汽车公司自己处理前进规则。从文件中:
注意:播放服务客户端中包含ProGuard指令
库来保留所需的类。Android插件
Gradle在AAR中自动附加ProGuard配置文件
(Android ARchive)包并将该包附加到ProGuard中
配置在项目创建过程中,Android Studio会自动
创建ProGuard配置文件和build.gradle属性
供ProGuard使用。要将ProGuard与Android Studio一起使用,必须启用
build.gradle buildTypes中的ProGuard设置。更多
有关详细信息,请参阅ProGuard指南
根据:
将应用程序的Play services依赖项升级到11.2.0或更高版本时,还必须更新应用程序的build.gradle,以指定至少26(Android)的CompileSDK版本。这不会改变应用程序的运行方式
更新您的
compileSdkVersion
(注意,您不需要更新您的targetSdkVersion
——这可以稍后完成),以便找到API 26中添加的引用方法。完美,这是正确的答案。如果您无法更新目标SDK版本(您应该始终以最新版本为目标,但如果出于任何原因必须这样做),那么API 25可以针对最高版本,因此您可以使用该版本。