I get this stacktrace during "dexguard" task (all lines did begin with timestamp and [ERROR] [org.gradle.BuildExceptionReporter]
):
Caused by: groovy.lang.MissingMethodException: No signature of method: com.android.build.gradle.internal.core.GradleVariantConfiguration.getAllLibraries() is applicable for argument types: () values: []
at com.guardsquare.dexguard.h.getProguardFiles(DexGuard7.1.23:1090)
at com.guardsquare.dexguard.ao.doCall(DexGuard7.1.23:784)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:590)
I'm using DexGuard v7.1.23, Android Studio 2.2, default gradle 2.14.1, on Windows 7 64b.
The error happens after I change (in all relevant build.gradle
scripts):
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.3'
+ classpath 'com.android.tools.build:gradle:2.2.0'
With gradle plugin 2.1.3 the build works.
I tried to debug it in Android Studio, by remotely connecting to gradle, but while the "pause" button in debugger looks like it pauses the process, and I can resume the execution, it will not show any code (probably needs sources of gradle and all involved plugins?).
I think the error is most likely in the dexguard gradle plugin code, which access something what is not available in android gradle plugin 2.2.0 anymore.
Question time:
How to even debug/fix something like this? I'm used to some non-trivial build schemes from huge C++ projects involving make files and various scripts executing external tools (where I can easily check every build error at source level and get exact idea what binary was called with what parameters and why), but this gradle ecosystem with so many dynamic parts downloaded from some network repositories and extremely slow Groovy execution control is a bit too complex for me, way over my head.
Is there (not very difficult) way to debug the build process (I'm not talking about native debugger and debugging the VM itself, while possible, that sounds useless in the result)? Maybe some simple way to get also source packages from repositories, similar to linux's -src.pkg, just by adding dependency?
Or can I find the cached dexGuard gradle plugin binary somewhere, disassemble it, check what it calls, and rewrite it by hand in my own script?
Any advices how to get more info about that gradle blackbox appreciated, ie. how it works, why it failed, etc... (although I'm not considering to learn also whole Groovy properly, especially as I don't get that mindset even for the core language (I'm simple guy, thinking in ASM and C++), and if I understand it well, the gradle extends it in quite domain specific way, so pure Groovy is not even enough to understand those scripts fluently?).