如何解决这些Proguard警告

编程入门 行业动态 更新时间:2024-10-28 17:30:02
本文介绍了如何解决这些Proguard警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在项目中使用的是第三方库,此后Proguard向我发出了这些警告,这些警告与该库无关.这是我正在使用的库:棒棒糖.

I am using a third party library in my project, since then proguard is issuing me these warnings, which I can't relate to that library, Here is the library I am using: Lollipin.

我得到的警告

Warning:android.databinding.DataBindingUtil: can't find referenced class android.databinding.DataBinderMapper Warning:android.databinding.ViewDataBinding: can't find referenced class android.databinding.DataBinderMapper Warning:there were 43 unresolved references to classes or interfaces. Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.

我尝试了什么?

我已经这样编辑proguard-rules.pro:

-keeppackagenames com.github.orangegangsters.lollipin

还是不走!我还尝试清理并重建也无法解决的项目.

Still no go! I have also tried to clean and rebuild project that also didn't work out.

这是build.gradle:

Here is build.gradle:

apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion '24.0.2' defaultConfig { applicationId "com.example.teach" minSdkVersion 15 targetSdkVersion 24 versionCode 27 versionName "5.0" } buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:24.2.1' compile('com.mikepenz:materialdrawer:5.6.0@aar') { transitive = true } compile ('com.github.orangegangsters:lollipin:2.0.0@aar') { transitive = true } compile 'com.google.android.gms:play-services-ads:9.6.0' } apply plugin: 'com.google.gms.google-services'

推荐答案

我遇到了同样的问题,因此我在proguard.cfg中添加了以下更改

I had same issue,so I added below change into my proguard.cfg

-dontwarn android.databinding.** -keep class android.databinding.** { *; } -dontwarn okio.** -dontwarn retrofit2.Platform$Java8 -keepclasseswithmembers class * { @retrofit2.http.* <methods>; }

更多推荐

如何解决这些Proguard警告

本文发布于:2023-11-13 21:30:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585371.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   Proguard

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!