Java 错误:任务';的执行失败:应用程序:transformClassesWithAndroidGradleClassShrinkerForDebug'; 问题

Java 错误:任务';的执行失败:应用程序:transformClassesWithAndroidGradleClassShrinkerForDebug'; 问题,java,android,xml,gradle,proguard,Java,Android,Xml,Gradle,Proguard,当我试图构建我的项目时,我得到了这个错误 错误:任务的执行失败 “:app:transformClassesWithAndroidGradleClassShrinkerForDebug” 收缩期间发现警告,请使用-dontwarn或-ignorewarnings来抑制这些警告 我的档案 应用程序build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 26 buildTools

当我试图构建我的项目时,我得到了这个错误

错误:任务的执行失败 “:app:transformClassesWithAndroidGradleClassShrinkerForDebug”

收缩期间发现警告,请使用-dontwarn或-ignorewarnings来抑制这些警告

我的档案 应用程序build.gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"

    dexOptions {
        maxProcessCount = 2
        javaMaxHeapSize = "2g"
    }


    dataBinding {
        enabled = true
    }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
        exclude 'META-INF/SearchFilter.properties'
        exclude 'META-INF/NOTICE' // will not include NOTICE file
        exclude 'META-INF/LICENSE' // will not include LICENSE file
        // as noted by @Vishnuvathsan you may also need to include
        // variations on the file name. It depends on your dependencies.
        // Some other common variations on notice and license file names
        exclude 'META-INF/notice'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license'
        exclude 'META-INF/license.txt'
    }

    defaultConfig {
        applicationId "com.mt.moviesiwanttowatch"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 4
        versionName "1.2"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            minifyEnabled true
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //Optional: see how to use the utility.
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
    implementation "com.android.support:support-v13:26.0.0-beta2"
    implementation 'com.android.support:design:26.0.0-beta2'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta1'
    implementation 'com.android.support:recyclerview-v7:26.0.0-beta2'
    implementation 'com.android.support:cardview-v7:26.0.0-beta2'
    implementation 'com.google.android.gms:play-services-analytics:11.0.2'
    implementation 'com.allattentionhere:fabulousfilter:0.0.2'
    implementation 'com.nightonke:boommenu:2.1.0'
    implementation 'com.github.Commit451:QuickActionView:2.0.0'
    implementation 'com.android.volley:volley:1.0.0'
    implementation 'com.nononsenseapps:filepicker:4.1.0'
    implementation 'net.simonvt.schematic:schematic:0.7.0'
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.3.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.1'
    implementation 'com.ramotion.cardslider:card-slider:0.1.0'


    implementation 'org.jsoup:jsoup:1.10.3'
    implementation 'com.google.code.gson:gson:2.8.1'
    implementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'
    implementation "net.dean.jraw:JRAW:0.9.0"
    implementation 'com.gordonwong:material-sheet-fab:1.2.1'
    implementation 'com.github.bumptech.glide:glide:4.0.0-RC1'
    implementation('com.google.android:flexbox:0.3.0') {
        exclude group: 'com.android.support'
    }
    implementation 'me.drozdzynski.library.steppers:steppers:0.4.0-SNAPSHOT'
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    implementation 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
    implementation 'com.afollestad.material-dialogs:core:0.9.4.5'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.github.jetradarmobile.desertplaceholder:desertplaceholder:1.2.3'
    implementation 'com.github.rubensousa:gravitysnaphelper:1.2'
    annotationProcessor 'com.android.databinding:compiler:2.3.3'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
    annotationProcessor 'net.simonvt.schematic:schematic-compiler:0.7.0'
}
project build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com"}
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
和proguard-rules.pro

# Add project specific ProGuard rules here.
# By defaulto, the flags in this file are appended to flags specified
# in C:\Users\CM\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

-keep class io.codetail.animation.arcanimator.** { *; }
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
问题
如何修改文件以解决此问题?

更改
buildTypes->debug->minifyEnabled=false

  • 删除
    multiDexEnabled true
    shrinkResources true
    useProguard false
  • minifyEnabled true
    更改为
    minifyEnabled false

  • 希望这有帮助

    您需要在
    proguard rules.pro
    中向所有第三方库添加-dontwarn或-ignorewarnings。您可以在them@StanislavBondar你能举例说明如何用proguard写这个吗?在您可以在此处找到解决方案之前,我没有使用过此选项: