我写了一个播放加密视频的应用程序。它运行正常但是当我想要预测apk时,会出现以下警告:
Information:Gradle tasks [:app:assembleRelease]
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.APKExpansionSupport
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile$ZipEntryRO
Warning:fr.maxcom.http.FileDataSource: can't find referenced class jcifs.smb.SmbFile
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile$ZipEntryRO
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.APKExpansionSupport
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile$ZipEntryRO
Warning:fr.maxcom.http.FileDataSource: can't find referenced class jcifs.smb.SmbFile
Warning:fr.maxcom.http.FileDataSource: can't find referenced class com.android.vending.expansion.zipfile.ZipResourceFile$ZipEntryRO
Warning:fr.maxcom.http.FileDataSource: can't find referenced class jcifs.smb.SmbFile
Warning:fr.maxcom.http.WifiSingleHttpServer: can't find referenced class com.google.android.gms.cast.CastDevice
Warning:there were 25 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Information:BUILD FAILED
Information:Total time: 9.897 secs
Information:1 error
Information:14 warnings
Information:See complete output in console
有什么建议?
将此行添加到proguard-rules文件解决了问题:
-dontwarn com.android.vending.expansion.zipfile.**, jcifs.smb.SmbFile, jcifs.http.*, com.google.android.gms.cast.CastDevice