Error creating APK when minifyEnabled true

I need to enable proguard, so I set minifyEnabled to true. However, when I try to create the release APK, I get the following error:

Error: execution completed for task ': app: packageRelease'. Unable to calculate hash from ... / app / build / intermediates / classes -proguard / release / classes.jar

Edit: it looks like I need to update my proguard rules to match the libraries I use. Here are my dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
    transitive = true;
    }
    compile('com.mopub.sdk.android:mopub:4.0.0@aar') {
        transitive = true;
    }
}

What is the best way to find out what proguard rules are for each of them? So far I have found "ButterKnife"

+4
source share
1 answer

-dontwarn , .

, , ( , - ), -keep -dontwarn , proguard-rules.pro.

, , , , , OkHttp, GitHub "" .

+11

Source: https://habr.com/ru/post/1614899/


All Articles