android - Unable to apply plugin: 'dexguard' at build.gradle file -
i've below error when add apply plugin: 'dexguard'
main module's build.gradle file.
error:unable load class 'com.android.build.gradle.baseplugin$postcompilationdata'. possible causes unexpected error include:
in case of corrupt gradle processes, can try closing ide , killing java processes.
- you using jdk version 'java version "1.7.0_67"'. versions of jdk 1.7 (e.g. 1.7.0_10) may cause class loading errors in gradle. please update newer version (e.g. 1.7.0_67). open jdk settings
- gradle's dependency cache may corrupt (this occurs after network connection timeout.) re-download dependencies , sync project (requires network)
- the state of gradle build process (daemon) may corrupt. stopping gradle daemons may solve problem. stop gradle build processes (requires restart)
- your project may using third-party plugin not compatible other plugins in project or version of gradle requested project.
my project's build.gradle file:
buildscript { repositories { flatdir dirs: 'c:/users/devrimtu/documents/programs/dexguard/dexguard6.1/lib' jcenter() } dependencies { classpath ':dexguard' classpath 'com.android.tools.build:gradle:1.2.3' } }
my main module's build.gradle file:
apply plugin: 'com.android.application' apply plugin: 'dexguard' android { .. buildtypes { debug { proguardfile getdefaultdexguardfile('dexguard-debug.pro') proguardfile 'dexguard-project.txt' proguardfile 'proguard-project.txt' } release { proguardfile getdefaultdexguardfile('dexguard-release.pro') proguardfile 'dexguard-project.txt' proguardfile 'proguard-project.txt' } } }
note: if remove apply plugin: 'dexguard'
line, error becomes:
error:(29, 0) gradle dsl method not found: 'getdefaultdexguardfile()' possible causes:
- the project 'androidworkspace' may using version of gradle not contain method. gradle settings
- the build file may missing gradle plugin. apply gradle plugin
extras:
dexguard v6.1
. , flatdir dirs
@ build.gradle
file correct location.v 1.3.0 (build 141.2117773)
gradle-2.4
problem solved after updating dexguard version 7.0.18.
Comments
Post a Comment