Gradle Build Failure

若如初见. 提交于 2019-11-30 16:58:08

I also had this issue when upgrading everything that is built related to 23 (Android Libraries, SDK etc).

This proguard configuration fixed it for me:

-dontwarn org.apache.http.**
-dontwarn android.net.http.AndroidHttpClient
-dontwarn com.google.android.gms.**
-dontwarn com.android.volley.toolbox.**

Source

Turns out I had omitted the getDefaultProguardFile('proguard-android.txt') line on the proguard files and was just using proguard-rules.pro

Lokesh Tiwari

added these two line in progaurd

-dontwarn android.net.http.AndroidHttpClient
-dontwarn com.google.android.gms.**

and it works..

It is related to library used in project.

The default ProGuard file already has a rule to ignore support library warnings. If you don't have it you can add to your file

-dontwarn android.support.**

but would be better to add the default one. See Proguard configuration@Android Developers

This also could happen due to errors/warnings related to included .jar files Check in build output for proguard warnings/errors.

I had issue related to opencsv jar file. Hint by Lakedaemon in above comment helped me and its solved.

Try to look up in the whole error message. It may contain info that you include a library twice. This was the problem in my case and it was fixed after removing duplicated includes.

Yazdan

Try add this code in your proguard-rules.pro:

-ignorewarnings 

It solved my problem.

I think your app build.gradle buildTypes > release > minifyEnabled is true

That cause you get this error message.

Avoid this error message, set buildTypes > release > minifyEnabled is false


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!