如何在使用play-services-wearable时解决有关缺少protobuf类的ProGuard警告(注释)

Nic*_*ick 6 dependencies android protocol-buffers gradle google-play-services

我有一个android wear 2.0项目,具有以下依赖项:

 compile 'com.google.android.gms:play-services-wearable:11.0.4' 
Run Code Online (Sandbox Code Playgroud)

play-services-wearable依赖导致对play-services-basement的继承依赖,其中包含com.google.protobuf.zzc等包含反射代码的类,例如:

final class zzc {
    private static Class<?> zzcrO = zzLq();

    private static Class<?> zzLq() {
        try {
            return Class.forName("com.google.protobuf.ExtensionRegistry");
        } catch (ClassNotFoundException var0) {
            return null;
        }
    }
Run Code Online (Sandbox Code Playgroud)

因此,此依赖性导致以下proguard注意:

Note: com.google.protobuf.zzc: can't find dynamically referenced class com.google.protobuf.ExtensionRegistry
Note: com.google.protobuf.zzd: can't find dynamically referenced class com.google.protobuf.Extension
Note: com.google.protobuf.zze: can't find dynamically referenced class libcore.io.Memory
Note: com.google.protobuf.zze: can't find dynamically referenced class org.robolectric.Robolectric
Note: there were 4 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Run Code Online (Sandbox Code Playgroud)

所以我的问题是:

  1. 我是否需要包含额外的依赖项以防止ProGuard显示上述注释?
  2. 如果是这样,为什么play-services-basement不会自动包含所需的传递依赖(即protobuf)?
  3. 将'-dontnote'规则添加到我的proguard文件以隐藏上述警告是否安全?我担心由于这段代码具有反思性,因此谷歌播放服务实际上可能会使用该代码并且如果我忽略该问题则会导致运行时异常.