2

Начну историю с начала.

Понадобилось мне подключить гугловую аналитику в приложение.
Для этого нужно подключить последнюю версию сервисов google play

compile 'com.google.android.gms:play-services:6.1.71'

Собственно после этого я словил 65K Reference Limit.

Решив эту проблему, я натолкнулся на следующую:

java.util.zip.ZipException: duplicate entry: org/apache/commons/io/CopyUtils.class

Вот последнюю не знаю как решить. У меня подключено прилично библиотек, и они за собой еще что-то тянут.

Каким то образом нужно понять, кто тянет эти зависимости и исключить. Может кто знает, как это сделать?

Вот мои зависимоти из gradle-файла:

dependencies
        {
            androidTestCompile 'com.google.guava:guava:18.0'
            androidTestCompile 'com.squareup.dagger:dagger:1.1.0'

            androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
            androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
            androidTestCompile 'org.hamcrest:hamcrest-library:1.1'

            androidTestCompile('junit:junit:4.11')
                    {
                        exclude module: 'hamcrest-core'
                    }
            androidTestCompile('org.robolectric:robolectric:2.3')
                    {
                        exclude module: 'classworlds'
                        exclude module: 'commons-logging'
                        exclude module: 'maven-artifact'
                        exclude module: 'maven-artifact-manager'
                        exclude module: 'maven-error-diagnostics'
                        exclude module: 'maven-model'
                        exclude module: 'maven-project'
                        exclude module: 'maven-settings'
                        exclude module: 'plexus-container-default'
                        exclude module: 'plexus-interpolation'
                        exclude module: 'plexus-utils'
                        exclude module: 'wagon-file'
                        exclude module: 'wagon-http-lightweight'
                        exclude module: 'wagon-provider-api'
                    }
            androidTestCompile 'com.squareup:fest-android:1.0.8'

            compile 'com.google.android.gms:play-services:6.1.71'
            compile 'com.google.code.gson:gson:2.3.1'
            compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:0.9.3'
            //compile 'com.nineoldandroids:library:2.4.0'
            compile 'com.android.support:multidex:1.0.0'
            compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
            compile 'com.github.chrisbanes.photoview:library:1.2.2'
            compile 'org.apache.sanselan:sanselan:0.97-incubator'
            compile ('com.android.support:appcompat-v7:21.0.2'){force = true}
            compile ('com.android.support:support-v4:21.0.2'){force = true}

            //ROBOSPICE
            compile 'com.octo.android.robospice:robospice:1.4.14'
            compile 'com.octo.android.robospice:robospice-google-http-client:1.4.14'
            compile 'com.google.http-client:google-http-client-gson:1.19.0' exclude module: 'httpclient'
            compile 'com.j256.ormlite:ormlite-android:4.48'
            compile 'com.octo.android.robospice:robospice-ormlite:1.4.14'

            compile 'org.roboguice:roboguice:3.0.1'
            provided 'org.roboguice:roboblender:3.0.1'

        }

1 ответ 1

1

В общем быстрого решения я не нашел, решил пойти медленным, но надежным. Я отключал модуль 'commons-io' у каждой зависимости, пока не нашел те, которые тянут.

Объясню подробно, на всякий случай.
Для начала я нашел название модуля, его можно взять в списке подключаемых библиотек(External Libraries). В моем случае, это 'commons-io' без версии библиотеки. Далее я нашел три зависимости, которые его тянут за собой

compile ('com.octo.android.robospice:robospice:1.4.14')
        {exclude module: 'commons-io'}

compile ('com.octo.android.robospice:robospice-google-http-client:1.4.14')
        {exclude module: 'commons-io'}

compile ('com.octo.android.robospice:robospice-ormlite:1.4.14')
        {exclude module: 'commons-io'}

alt text

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.