我想最新的MoPub SDK(5.3)更新了ExoPlayer的版本。我的应用程序也使用ExoPlayer。生成签名的apk时,我现在收到下面的警告。如果我加一个
dontwarn
若要进行proguard,则我的代码将失败,因为它在运行时找不到这些字段。
我的proguard上有这个,它已经工作了很长一段时间,直到今天更新MoPub之后才开始失败。
-keep class com.google.android.exoplayer2.** { *; }
-keep interface com.google.android.exoplayer2.**{ *; }
-keepclassmembers class com.google.android.exoplayer2.** { *; }
这是错误:
Warning: MyClass: can't find referenced field 'int mediaSequence' in program class com.google.android.exoplayer2.source.hls.playlist.HlsMediaPlaylist
Warning: MyClass: can't find referenced field 'boolean isEncrypted' in program class com.google.android.exoplayer2.source.hls.playlist.HlsMediaPlaylist$Segment
Warning: MyClass: can't find referenced field 'java.lang.String encryptionKeyUri' in program class com.google.android.exoplayer2.source.hls.playlist.HlsMediaPlaylist$Segment
我能做些什么来避免这个错误?
更新:字段的定义如下:
public final int mediaSequence;
public final boolean isEncrypted;
public final String encryptionKeyUri;