我在尝试将 dexguard 集成到我的 android/gradle 项目时遇到了一些麻烦。
- 敏捷卫士:5.5.32
- 等级:2.2.1
- 毕业插件:1.3.0
- 构建工具版本:23.0.1
我收到以下错误apply plugin: 'dexguard'
:
Error:Unable to load class 'com.android.builder.SdkParser'
编辑:
这是我的应用程序的 gradle 文件:
buildscript {
repositories {
flatDir { dirs '/usr/local/DexGuard5.5.32/lib' }
jcenter()
}
dependencies {
classpath ':dexguard:'
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'dexguard' //This, when uncommented produces the error
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/commons-collections4-4.0.jar')
compile files('libs/commons-codec-1.10.jar')
compile files('libs/gson-2.3.1.jar')
compile files('libs/jaxb2-maven-plugin:2.1.jar')
compile project(':sdk')
compile project(':zxing-lib')
}
android {
signingConfigs {
release {
//my signing config
}
}
compileSdkVersion 22
buildToolsVersion '23.0.1'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'src/main/native', 'src/test/java']
resources.srcDirs = ['src/main/java', 'src/main/native', 'src/test/java']
aidl.srcDirs = ['src/main/java', 'src/main/native', 'src/test/java']
renderscript.srcDirs = ['src/main/java', 'src/main/native', 'src/test/java']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
buildTypes {
//The following should be uncommented when dexuard works!!!
// debug {
// proguardFile plugin.getDefaultDexGuardFile('dexguard-debug.pro')
// proguardFile 'dexguard-project.txt'
// proguardFile 'dexguard-project-debug.txt'
// proguardFile 'proguard-project.txt'
// }
// release {
// proguardFile plugin.getDefaultDexGuardFile('dexguard-release.pro')
// proguardFile 'dexguard-project.txt'
// proguardFile 'dexguard-project-release.txt'
// proguardFile 'proguard-project.txt'
// }
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
}
defaultConfig {
targetSdkVersion 22
signingConfig signingConfigs.release
}
productFlavors {
app2 {
applicationId "some.app.id"
}
app {
applicationId "some.app.id2"
}
}
}
你觉得呢?你有没有什么想法 ??