首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >启用proguard后调试应用构建失败

启用proguard后调试应用构建失败
EN

Stack Overflow用户
提问于 2017-11-17 14:53:40
回答 1查看 399关注 0票数 0
代码语言:javascript
复制
Error:Execution failed for task 
':app:transformClassesWithAndroidGradleClassShrinkerForDebug'. 
Warnings found during shrinking, please use -dontwarn or -ignorewarnings to suppress them.

我该如何解决这个问题?

另外,我还想在我的应用程序中使用progaurd

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    dexOptions{
        javaMaxHeapSize="2g"
    }

    defaultConfig {
        applicationId "com.example.projetinnovation.newadvocatediary"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled=true

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

repositories {
    maven {
        url "https://jitpack.io"
    }
    google()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(path: ':agendacalendarview')
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support:design:26.+'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.8.+'
    compile 'com.github.clans:fab:1.6.4'
    compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.github.ybq:Android-SpinKit:1.1.0'
    compile 'com.android.support:cardview-v7:26.+'
    compile 'com.github.d-max:spots-dialog:0.7@aar'
    compile 'com.github.ganfra:material-spinner:2.0.0'

    compile 'com.android.support:multidex:1.+'
}

apply plugin: 'com.google.gms.google-services'
EN

回答 1

Stack Overflow用户

发布于 2017-11-17 15:04:08

您需要将-dontwarn或-ignorewarnings添加到proguard-rules.pro中的所有第三方库中。您可以在文档/维基页面上找到它们的说明

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47344900

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档