JY2k
JY2k

Reputation: 2909

Android proguard same jar specified twice

I have a project with two dependency projects in the libraries folder. Both are libraries which i wrote. Error:Execution failed for task ':app:proguardgmobileRelease'.

java.io.IOException: The same input jar [/Users/Jon/android-app-manager/app/libs/**] is specified twice.

The main project dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.android.support:recyclerview-v7:21.0.3'
    compile 'com.android.support:cardview-v7:21.0.3'
    compile 'com.squareup.okhttp:okhttp:2.2.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'commons-io:commons-io:2.0.1'
    compile 'org.roboguice:roboguice:3.0.1'
    provided 'org.roboguice:roboblender:3.0.1'
    compile 'com.google.code.findbugs:jsr305:1.3.9'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile project(':android-commons')
    compile project(':ormlitewrapper')
    compile('com.crashlytics.sdk.android:crashlytics:2.2.2@aar') {
        transitive = true;
    }
}

The android-commons project dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.squareup.okhttp:okhttp:2.2.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'commons-io:commons-io:2.0.1'
    compile 'com.google.android.gms:play-services-base:6.5.87'
}

The OrmLiteWrapper project dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile project(':android-commons')
}

The main project compiles the 2 sub project and ormLiteWrapper compiles the android-commons as well. I was unable to remove the dependency and don't know where I can find the solution for the cyclic dependency. Should it be defined in one place and referenced in the other? The issue only creates a conflict when generating a release APK.

Upvotes: 4

Views: 4794

Answers (1)

Tapa Save
Tapa Save

Reputation: 4857

Don't use -libraryjars or -injar or -oujar in your proguard file

Upvotes: 4

Related Questions