Не удалось построить android gradle с Crashlytics 2.6.7 и io.ветка.пакет SDK.андроид.библиотека: 2+ в то время как proguard включить?


Мои Настройки Gradle:

compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
    transitive = true;
}

compile('io.branch.sdk.android:library:2.+') {
    transitive = true;
}

С вышеуказанными crashlytics & branch.io попробуйте построить gradle с включенным proguard. Я становлюсь ниже ошибки.

Warning:Exception while processing task java.io.IOException: Can't write [/Users/Documents/test/andriod-test/app/build/intermediates/transforms/proguard/production/release/jars/3/1f/main.jar] (Can't read [/Users/Documents/test/andriod-test/app/build/intermediates/classes/production/release(;;;;;;**.class)] (Can't read [com] (Can't read [crashlytics] (Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class])))))))) Error:java.lang.RuntimeException: Job failed, see logs for details Error:java.io.IOException: Can't write [/Users/Documents/test/andriod-test/app/build/intermediates/transforms/proguard/production/release/jars/3/1f/main.jar] (Can't read [/Users/Documents/test/andriod-test/app/build/intermediates/classes/production/release(;;;;;;**.class)] (Can't read [com] (Can't read [crashlytics] (Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class])))))))) Error:java.io.IOException: Can't read [/Users/Documents/test/andriod-test/app/build/intermediates/classes/production/release(;;;;;;**.class)] (Can't read [com] (Can't read [crashlytics] (Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class]))))))) Error:java.io.IOException: Can't read [com] (Can't read [crashlytics] (Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class])))))) Error:java.io.IOException: Can't read [crashlytics] (Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class]))))) Error:java.io.IOException: Can't read [android] (Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class])))) Error:java.io.IOException: Can't read [answers] (Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class]))) Error:java.io.IOException: Can't read [shim] (Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class])) Error:java.io.IOException: Can't read [R.class] (Duplicate zip entry [com/crashlytics/android/answers/shim/R.class]) Error:java.io.IOException: Duplicate zip entry [com/crashlytics/android/answers/shim/R.class]

1 2

1 ответ:

Поскольку сообщение об ошибке указывает, что некоторые из классов' answers-shim ' дублируются, один из них от crashlytics, а другой от io.ветвь сама по себе, то, что я сделал, это исключить Ио.модуль ответвления 'answers-shim', отредактировав файл gradle ниже.

compile('io.branch.sdk.android:library:2.+') {
    transitive = true;
    exclude module: 'answers-shim'
}

Исключить 'ответ-ШИМ модуля к Ио.ветка.пакет SDK.настройки библиотеки gradle, как показано выше.

После этого в файле proguard добавьте следующую строку, чтобы игнорировать предупреждения:

-dontwarn com.crashlytics.android.answers.shim.**