2

I am trying to configure my android studio project with Dexguard. I am not understanding how to tell gradle where to get my license. My license is at the root location of my project (i.e. at the same location as my /app directory). And the name is dexguard-license.txt

Also, here is the error I am getting when I run

enter image description here

I keep troubleshooting and ended up with

enter image description here

Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
  • Your error has nothing to do with any license. As you can see from the error the required jar file cannot be found. – Xaver Kapeller Jul 06 '16 at 15:41
  • Sorry for misnaming my question. I didn't really know what was wrong; I am just trying to get the basic configuration to work. I can ask a different question if I have to, or perhaps someone will help me on this thread. For the bug, even after I use the full path in `flatDir { dirs ...}` I still get the same bug. Does that mean my dexguard is missing something or that my gradle is misconfigured? – Katedral Pillon Jul 06 '16 at 15:52

2 Answers2

2

DexGuard will look in the following locations for a valid license file (in this order):

  • in the directory path or license file path that you can specify with the Java system property dexguard.license, or

  • in the directory path or license file path that you can specify with the OS environment variable DEXGUARD_LICENSE, or

  • in your home directory, or

  • in the directory that contains your DexGuard plugin jar.

Edit: in case the DexGuard jar can not be found, you are probably missing the following snippet:

buildscript {
    repositories {
        flatDir { dirs '/path/to/your/dexguard/installation/lib' }
        ...
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:x.x.x'
        classpath ':dexguard:'
    }
}
T. Neidhart
  • 6,060
  • 2
  • 15
  • 38
  • 1
    Dude, you just copied and pasted the exact document from the mdexguard tutorial. If I understood what they meant, I wouldn't ask here for help. :) I know you are just trying to help. But unfortunately, that verbiage means nothing to me somehow. – Katedral Pillon Jul 06 '16 at 15:35
  • What is so complicated about it? Place your dexguard-license.txt either in your home directory, in the lib folder of your DexGuard installation or otherwise you specify the location with some system properties. – T. Neidhart Jul 06 '16 at 15:38
  • Now I get it! Apparently it was already in the lib directory of the dexguard. Now for the exception, I am using `flatDir { dirs './dexguardStuff/DexGuard-7.2.00/lib' }` do you know how I may fix this? the directory `dexguardStuff` is at the same level as the `app` directory. I also tried `flatDir { dirs '/dexguardStuff/DexGuard-7.2.00/lib' }` – Katedral Pillon Jul 06 '16 at 15:43
1

Following up your edited question regarding the class version error:

This is apparently a mistake of the 7.2.00 release. It was compiled with a Java 8 compiler and some files have not been targeted for Java 1.6. This means that this release requires you to use a Java 8 runtime to work properly.

This will be fixed in the next release 7.2.01.

T. Neidhart
  • 6,060
  • 2
  • 15
  • 38