How to use custom proguard.jar in gradle build?

I am trying to run proguard in my application that includes Unity 3D. Currently, proguard is not trying to process single-classes.jar, and the only workaround is to create a proguard yourself with the patch applied (see this link for an error report).

So now I have my own custom proguard.jar, but how can I get the android plugin to use it? With eclipse, this was just a replacement for proguard.jar in the Android SDK directory, but it no longer works with Android Studio / Gradle. In fact, I can delete proguard files from tools / proguard / lib /, and it works anyway!

How can I get Android Studio / Gradle to use my own custom proguard.jar?

+5
source share
1 answer

I solved this by placing a custom proguard.jar in a directory named "proguard" in the root folder (not the project root folder) and configured the gradle file as follows:

buildscript { repositories { flatDir { dirs 'proguard' } mavenCentral() } dependencies { classpath 'proguard.io:proguard:5.0' classpath 'com.android.tools.build:gradle:0.12.+' } } 
+4
source

Source: https://habr.com/ru/post/1202265/


All Articles