I am trying to build an android app using scala and android studio. The compile fails at proguard with an exception:
Error:java.lang.ArrayIndexOutOfBoundsException: 4
at proguard.classfile.editor.InterfaceDeleter.visitSignatureAttribute(InterfaceDeleter.java:162)
at proguard.classfile.attribute.SignatureAttribute.accept(SignatureAttribute.java:97)
I found at another place (http://sourceforge.net/p/proguard/bugs/549/) that this issue is caused by a bug in scala, but that it only occurs in proguard 5.1 and not in proguard 5.0.
Now my question is: how can I setup android studio so that it will use proguard 5.0?
Found it!
The trick is to exclude proguard 5.1 in the toplevel buildfile, and add a dependency on 5.0 instead.
Here is my toplevel build file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath ('com.android.tools.build:gradle:1.0.0') {
exclude module: 'proguard-gradle'
}
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.3.1"
classpath ('net.sf.proguard:proguard-gradle:5.0') {
force = true
}
}
}
allprojects {
repositories {
jcenter()
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With