带有 -keep 标志的任务 ':app:transformClassesAndResourcesWithProguardForRelease' 执行失败

Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease' with -keep flag

我希望有人可以帮助解决这些特定的构建失败 - 我已经看过所有 SO 线程并尝试了主要线程,我的具体错误:

Error:Warning: com.google.android.maps.MapView$Repainter: can't find superclass or interface android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestListener
Warning: com.google.android.maps.MapView$Repainter: can't find referenced class android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestListener
Warning: com.google.android.maps.MapView$Repainter: can't find referenced class android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequest
Warning: com.google.android.maps.ZoomHelper$Snapshot: can't find referenced class android_maps_conflict_avoidance.com.google.map.Zoom
Warning: there were 4 unresolved references to classes or interfaces.
     You may need to add missing library jars or update their versions.
     If your code works fine without the missing classes, you can suppress
     the warnings with '-dontwarn' options.
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.

Job failed, see logs for details

我的构建文件发布部分:

release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }

所以在 proguard-rules.txt 我试过了

-ignorewarnings
-keep class * {
public private *;
}

更具体地说我试过了

 -keep public class com.google.android.gms.* { public *; }
 -dontwarn com.google.android.gms.**

这些似乎都不起作用 - 我能做些什么来真正弄清楚它是否正在读取这个 proguard txt 文件?

还有其他建议吗?

好吧,没花多长时间,但我进入了构建 -> 编辑构建类型,在这里我选择了 release,然后手动选择了我的 proguard-rules.txt,单击确定,它基本上添加了

proguardFile '.../StudioProjects/App/proguard-rules.txt'

使构建成功运行。