This article lists common issues you may encounter with the PreEmptive Protection™ DashO™ Gradle Plugins for Java (com.preemptive.dasho, com.preemptive.dashoJar, and com.preemptive.dashoCustom), with their causes and resolutions. Work through the sections in order: verify the plugin is applied, verify the configuration, then check for errors during and after protection. For issues in DashO itself, see the Troubleshooting FAQ.
Verify That a Plugin Is Applied
- Run
gradlew tasks, orgradlew tasks --all. - Check the task list:
- If you applied
com.preemptive.dashoorcom.preemptive.dashoJar, tasks such asobfuscateorobfuscateJarappear in the Build tasks section. - With plugin version 1.8 or later, a
dashOPluginVersiontask appears in the Help tasks section. Before plugin version 4.0, it appears in the Other tasks section.
- If you applied
- If you don't get an error but don't see these tasks, make sure you applied the plugin in your build script.
Errors When You Apply a Plugin
Error: Unexpected char '\' ... flatDir dirs:
Cause: The DashO Home path uses backslashes.
Resolution: Use forward slashes (/) in the DashO Home path.
Error: Could not find method dashOConfig() for arguments...
Cause: No DashO plugin is applied, or dashOConfig is inside another closure.
Resolution: Apply com.preemptive.dasho, com.preemptive.dashoJar, or com.preemptive.dashoCustom, and make sure dashOConfig isn't inside any other closure.
Error: Plugin with id 'com.preemptive.dasho*' not found.
Cause: The plugins aren't referenced in the buildscript dependencies closure.
Resolution: Reference the plugins in the buildscript dependencies closure.
Error: Could not find any version that matches com.preemptive:dasho:X.Y+.
Cause: The buildscript repositories closure doesn't reference the directory that contains dasho-x.y.z.jar.
Resolution: Reference that directory in the buildscript repositories closure.
Error: Could not set unknown property '{some name}' for object of type com.preemptive.dasho.gradle.DashOExtension
Cause: {some name} isn't a supported setting, or your plugin version doesn't support it.
Resolution: Make sure {some name} is listed in the configuration settings. If the property is one of the following, upgrade the plugins to the listed version or later:
-
maxHeap: 1.7.0 -
verbose: 2.3.4 -
debug: 3.2.0
Error: Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput
Cause: The com.preemptive.dasho plugin doesn't support Gradle 5.
Resolution: Use Gradle 4.x with that plugin.
Verify the Configuration
- Run
gradlew build. - If you applied and configured a plugin correctly, DashO protects your code. If you get an error, see the entries in this section.
Error: File '{project path}/project.dox' specified for property 'doxFile' does not exist.
Cause: DashO can't find the project file. By default, it looks for project.dox.
Resolution: Set doxFilename in the dashOConfig closure.
Error: DashOHome is not configured.
Cause: DashO Home isn't set.
Resolution: Set dashOHome in the dashOConfig closure, or set the DASHO_HOME environment variable. See Configuring the Plugin.
Error: tried to access method org.gradle.api.tasks.JavaExec.exec()V...
Cause: Your Gradle version is too old.
Resolution: Upgrade Gradle.
Error: Cannot find "{some name}" in: {name} -- {path} ...
Cause: A name in includeAsInputs is misspelled.
Resolution: Check the spelling of the name in includeAsInputs.
Errors During Protection
When DashO fails while it runs, the error appears in the output. First, make sure your DashO configuration uses ${gradleInput} and ${gradleOutput}.
Error: java.lang.OutOfMemory: Java heap space or java.lang.OutOfMemory: GC overhead limit exceeded
Cause: DashO ran out of memory.
Resolution: Increase or set maxHeap. See the configuration settings. For plugin versions earlier than 1.7:
-
Add a task to the Gradle build script, using the task names you see when you run gradlew tasks:
task setMaxMem { doLast { project.tasks['obfuscateDebug'].maxHeapSize=536870912 //bytes project.tasks['obfuscateRelease'].maxHeapSize=536870912 //bytes } } - Run it before your build task, for example
gradlew setMaxMem build.
Error: Option --properties not understood.
Cause: Your DashO version is too old.
Resolution: Use DashO 8.1.0 or later.
Issues After Protection
A misconfigured project file can cause these issues.
There are no classes in the JAR file Gradle creates (com.preemptive.dasho plugin)
Cause: The project file doesn't output to ${gradleOutput} as a merged directory.
Resolution: Set the output location in the project file to ${gradleOutput}, and make it a merged directory.
The obfuscated_libs directory is missing from the build folder (com.preemptive.dashoJar plugin)
Cause: The project file doesn't output to ${gradleOutput} as a JAR file.
Resolution: Set the output location in the project file to ${gradleOutput}, and make it a JAR file.
Diagnostic Tools
Temporarily Disable the DashO Integration
To run a build without the DashO tasks, add -DDISABLE_DASHO to the gradlew command line.
Show the Parameters Passed to DashO
To print the contents of the .properties file passed to DashO and the full DashO command line, add -DSHOW_DASHO_CMD to the gradlew command line. Requires plugin version 1.7 or later.