最近我推了一个应用程序(已启用Proguard)来玩商店,但它开始在我的活动上报告NoClassDefFoundError(不是任何库活动),这些都发生在Android OS版本4.0.4 - 4.4.2上。任何帮助将不胜感激。
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'android-apt'
apply plugin: 'jacoco'
def final myApplicationId = 'myapp.appModules.login'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId myApplicationId
minSdkVersion 15
resConfigs "en"
targetSdkVersion 23
compileOptions.encoding = 'windows-1252'
/** compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}*/
}
dexOptions {
javaMaxHeapSize "4g"
}
testOptions {
unitTests.returnDefaultValues = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
debuggable false
jniDebuggable false
renderscriptDebuggable false
zipAlignEnabled true
}
debug {
testCoverageEnabled true
}
}
productFlavors
{
production
{
}
staging
{
}
quality
{
}
dev
{
}
}
}
repositories {
mavenCentral()
}
task jacocoTestReport(type: JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage reports"
// exclude auto-generated classes and tests
def fileFilter = ['**/R.class', '**/R$*.class',
'**/BuildConfig.*', '**/Manifest*.*',
'android/**/*.*', '**/*$ViewBinder*.*', '**/view/**', '**/vo/**/*.*']
def debugTree = fileTree(dir:
"${project.buildDir}/intermediates/classes/production/debug",
excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
additionalSourceDirs = files([
"${buildDir}/generated/source/buildConfig/production/debug",
"${buildDir}/generated/source/r/production/debug"
])
executionData = fileTree(dir: project.projectDir, includes:
['**/*.exec', '**/*.ec'])
reports {
xml.enabled = true
xml.destination = "${buildDir}/jacocoTestReport.xml"
csv.enabled = false
html.enabled = true
html.destination = "${buildDir}/reports/jacoco"
}
}
dependencies {
compile project(':ImageCropper')
compile project(':dropboxChooserSDK')
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.facebook.android:facebook-android-sdk:3.23.1'
compile 'com.google.android.gms:play-services-drive:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile files('libs/volley.jar')
compile files('libs/comscore.jar')
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
testCompile 'org.mockito:mockito-all:1.10.19'
testCompile 'org.powermock:powermock-api-mockito:1.6.4'
testCompile 'org.powermock:powermock-module-junit4:1.6.4'
testCompile 'junit:junit:4.12'
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:22.2.0'
}