This is in relation to:
Apologies for the double post. I think this is actually a slightly different problem now. While I solved my initial issue, it introduced a few small problems with dependencies (e.g. they need to exist before compiling) that I am now trying to figure out…
First, I have no clue if I am doing this correctly. I am mostly just trying to get this to work while learning Gradle.
A quick summary of the proguard issue:
- I have two libraries (A and B) that are obfuscated, but one of the libraries uses the others obfuscated methods (therefore as part of compiling my release obfuscated builds Library B needs to depend on a unobfuscated Library A - which is then itself obfuscated).
- In Android Studio, if my ‘Release App’ depends on the ‘Release’ version of Library B and A - it complains that Library B depends on the Debug version (Unobfuscated) of Library A.
My solution in the ‘proguard’ thread was to re-direct the ‘aar’ files to a folder and use a ‘flatDir’ to point to that folder. The ‘release’ version of the app therefore does not depend on compilation of the libraries, but only the existence of the aar file which is obfuscated.
releaseCompile project(path: ‘:core’, configuration:‘release’)
releaseCompile(name: ‘core-release’, ext: ‘aar’)
The issue that this introduces is that the build output in a release build aar does not exist until after Library A/B are built. On our build server, we set it up so that we individually build the modules prior to the sample app, then build the sample app after the aar files exist in the build/output folder.
This does not work so well in Android Studio. Is there anyway to either:
- ignore the dependency not existing
- force the building of the other modules BEFORE evaluating the dependencies in our app.
Thanks for any feedback or help.