Gradle Plugins for Java Troubleshooting
- Verifying That a Plugin Has Been Applied
- Errors
- Error: Could not find method dashOConfig() for arguments...
- Error: Plugin with id 'com.preemptive.dasho*' not found.
- Error: Could not find any version that matches com.preemptive:dasho:X.Y+.
- Error: Could not set unknown property '{some name}' for object of type com.preemptive.dasho.gradle.DashOExtension
- Error: Could not set unknown property 'maxHeap' for object of type com.preemptive.dasho.gradle.DashOExtension
- Error: Could not set unknown property 'verbose' for object of type com.preemptive.dasho.gradle.DashOExtension
- Error: Could not set unknown property 'debug' for object of type com.preemptive.dasho.gradle.DashOExtension
- Error: Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput
- Verifying the configuration is correct
- Error: File '{project path}/project.dox' specified for property 'doxFile' does not exist.
- Error: DashOHome is not configured.
- Error: tried to access method org.gradle.api.tasks.JavaExec.exec()V...
- Error: Cannot find "{some name}" in: {name} -- {path} ...
- Errors during protection
- Error: java.lang.OutOfMemory: Java heap space or java.lang.OutOfMemory: GC overhead limit exceeded
- Error: Option --properties not understood.
- Gradle issues after protection
- Temporarily Disabling DashO Integration
- Troubleshooting Parameters
Verifying That a Plugin Has Been Applied
Run gradlew tasks [-all]
If you applied the com.preemptive.dasho
or com.preemptive.dashoJar
plugin, you should see tasks like obfuscate
or obfuscateJar
listed in the build
section.
If you are using version 1.8 or later of the plugins, you should see a dashOPluginVersion
task listed in the Help tasks
section.
Prior to 4.0, it will be in the Other tasks
section.
If you do not encounter an error and do not see one of those tasks listed, make sure you have applied the plugin in your script.
Errors
Here are some common errors and solutions:
Error: Unexpected char '\' ... flatDir dirs:
Make sure you use forward slashes ('/') when specifying the DashO Home path.
Error: Could not find method dashOConfig() for arguments...
Make sure you apply one of the plugins: com.preemptive.dasho
, com.preemptive.dashoJar
, or com.preemptive.dashoCustom
.
Also make sure that dashOConfig
is not inside any other closure.
Note: You will see this error if you are attempting to use version 4.0 or later of the plugins with an Android project. You will need to use the new DashO Gradle Plugin for Android instead.
Error: Plugin with id 'com.preemptive.dasho*' not found.
Make sure you have referenced the plugins in the buildscript dependencies closure.
Error: Could not find any version that matches com.preemptive:dasho:X.Y+.
Make sure you have referenced the directory containing the dasho-x.y.z.jar
file in the buildscript repositories closure.
Error: Could not set unknown property '{some name}' for object of type com.preemptive.dasho.gradle.DashOExtension
Make sure {some name}
is a setting listed on the configuration page.
Note: The Android specific settings were removed in version 4.0.0. If you are using an earlier version of the plugins, please see the online documentation.
Error: Could not set unknown property 'maxHeap' for object of type com.preemptive.dasho.gradle.DashOExtension
Make sure you are using version 1.7.0 (or later) of the DashO Gradle Plugins for Java.
Error: Could not set unknown property 'verbose' for object of type com.preemptive.dasho.gradle.DashOExtension
Make sure you are using version 2.3.4 (or later) of the DashO Gradle Plugins for Java.
Error: Could not set unknown property 'debug' for object of type com.preemptive.dasho.gradle.DashOExtension
Make sure you are using version 3.2.0 (or later) of the DashO Gradle Plugins for Java.
Error: Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput
The com.preemptive.dasho
plugin does not support Gradle 5. Please use Gradle 4.x with that plugin.
Verifying the configuration is correct
Run gradlew build
If you applied and configured a plugin correctly, DashO will protect your code.
If you encounter an error, here are some common errors and solutions:
Error: File '{project path}/project.dox' specified for property 'doxFile' does not exist.
Make sure you have specified the doxFilename
in the dashOConfig
closure.
By default, it looks for project.dox
.
Error: DashOHome is not configured.
Make sure you either specify the dashOHome
in the dashOConfig
closure or in the DASHO_HOME
environment variable.
Please see Configuring the Plugin for more details.
Error: tried to access method org.gradle.api.tasks.JavaExec.exec()V...
You are using an old version of Gradle, please upgrade to a later version.
Error: Cannot find "{some name}" in: {name} -- {path} ...
Make sure you spelled the name correctly in includeAsInputs
.
Errors during protection
If an error occurs while DashO is running, the information should be listed in the output.
Double check that you used ${gradleInput}
and ${gradleOutput}
in your DashO configuration.
Error: java.lang.OutOfMemory: Java heap space or java.lang.OutOfMemory: GC overhead limit exceeded
Increase (or set) the maxHeap (see the configuration section). If you are using a version earlier than 1.7 try the following:
Add a new task to the gradle build script. Make sure you define it with the proper task name(s) you see when running
gradlew tasks
.task setMaxMem { doLast { project.tasks['obfuscateDebug'].maxHeapSize=536870912 //bytes project.tasks['obfuscateRelease'].maxHeapSize=536870912 //bytes } }
Call it manually before your build task (e.g.
gradlew setMaxMem build
)
Error: Option --properties not understood.
Make sure you are using version 8.1.0 (or later) of DashO.
Gradle issues after protection
Some errors can occur from misconfiguration of the project .dox
file.
Issue: I am using the com.preemptive.dasho
plugin and there are no classes in the jar file created by Gradle.
Make sure you have used ${gradleOutput}
as the output location the .dox
file (and that it is a merged directory).
Issue: I am using the com.preemptive.dashoJar
plugin and do not see the obfuscated_libs
directory in my build folder.
Make sure you have used ${gradleOutput}
as the output location the .dox
file (and that it is a jar file).
Temporarily Disabling DashO Integration
If you would like to run a build without the tasks added by DashO, you can disable them by adding -DDISABLE_DASHO
to the command line when you run gradlew
.
Note: The
DISABLE_DASHO
setting will have no impact if you are using thecom.preemptive.dashoCustom
plugin as it does not add any tasks.
Troubleshooting Parameters
If you would like to see all the parameters passed to DashO, add -DSHOW_DASHO_CMD
to the command line when you run gradlew
.
This will print out the contents of the .properties
file passed to DashO and show the full command line used to run DashO.
Note: This is only supported in versions 1.7 and later.