Android proguard same jar specified twice - android

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.

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

Related

Why can't I add Google Cast Companion Library to my project?

Currently, my project uses the Cast Companion library from sources. Here are my dependencies in my build.gradle file:
dependencies {
compile files('../../external/commonlibs/json/json-io-2.6.0.jar')
compile fileTree(dir: '../../external/commonlibs/annotations', include: '*.jar')
compile fileTree(include: '*.jar', dir: 'src/main/libs')
compile project(':common')
compile project(':common_ui')
compile project(':android-google-play-services_lib-v22')
compile project(':android-CastCompanionLibrary-v22')
compile project(':adara-middleware')
compile project(':android-support')
compile project(':android-mediarouter')
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
testCompile fileTree(dir: '../../external/testlibs', include: '*.jar')
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
androidTestCompile 'com.android.support.test:rules:0.3'
}
I want to remove the line "compile project(':android-CastCompanionLibrary-v22')" and replace it with:
compile 'com.google.android.libraries.cast.companionlibrary:ccl:2.9.1'
When I do this, I get the following error:
Error:A problem occurred configuring root project 'Fling'.
> Could not resolve all dependencies for configuration ':_myCatapulTVeDebugApkCopy'.
> Could not find com.google.android.libraries.cast.companionlibrary:ccl:2.9.1.
Required by:
:Fling:unspecified
I am following the instructions from this link: https://github.com/googlecast/CastCompanionLibrary-android

Failer to import with gradle thrivecom.ringcaptcha

Im trying to import an sdk called ringcaptcha and unfortunately I have followed their docs without much success. I have the following statement in my build.gradle file:
repositories {
maven { url 'http://ringcaptcha.github.io/ringcaptcha-android'}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:percent:23.3.0'
compile 'com.google.android.gms:play-services-maps:6.5.87'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.thrivecom:ringcaptcha:1.0.8#aar' // SMS service
}
And I get Failed to resolve com.thrivecom.ringcaptcha:1.0.8 ?

Attribute "titleTextStyle" has already been defined in android studio 1.2.1?

Below are my app dependencies
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
// compile 'com.android.support:support-v13:21.0.3'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile files('src/libs/android_sync_service_library.jar')
compile files('src/libs/gson-2.2.4.jar')
compile 'com.google.android.gms:play-services:7.3.0'
compile('com.crashlytics.sdk.android:crashlytics:2.2.2#aar') {
transitive = true;
}
compile project('my module name')
}
and my module dependencies
dependencies {
compile project(':ingosdk')
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/A2iA.Mobility.jar')
compile files('libs/acra-4.5.0.jar')
compile files('libs/bugsense-3.5.jar')
compile files('libs/deviceprint-lib-1.0.0.jar')
compile files('libs/espresso-1.1-bundled.jar')
compile files('libs/FlurryAnalytics-5.3.0.jar')
compile files('libs/httpmime-4.1.2.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/volley.jar')
}
I am using ActionBarSherlock in my module and appcompat v7 library in my application. In my case both are required. How can I solve the "attribute already defined" issue?
The versions I use in my app:
buildToolsVersion 22.0.1
targetSdkVersion 21
You can't use appcompat-v7 and actionbarsherlock at the same time, just use one of them.

ParseFacebookUtils not recognised on android studio

I added Parse-1.9.1.jar to my libs folder and compiled it in my build.gradle file in my app folder. But when i try to initialise parseFacebookUtil, it is not recognised. I dont know why.Below is my build.gradlr. Please help me find out what am missing, thanks
dependencies {
compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
compile 'com.android.support:appcompat-v7:22.+'
compile fileTree('src/main/libs')
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/picasso-2.4.0.jar')
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile files('libs/Parse-1.9.1.jar')
compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
}
Where you have
compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
Try
compile fileTree(dir: 'libs', include: 'ParseFacebookUtilsV4-*.jar')
instead. Dunno why it would work, but I had the same problem and that solved it for me. If that doesn't help, does the gradle sync/build properly without the ParseFacebook.... line?

Class android.support.v4.net.* has already bee added to output

I've just updated to Android Studio 1.0 RC 4 and it gives me some strange errors, but I can't figure out why.
The errors are:
Error:Class android.support.v4.net.ConnectivityManagerCompatGingerbread has already been added to output. Please remove duplicate copies.
Error:Class android.support.v4.net.TrafficStatsCompat has already been added to output. Please remove duplicate copies.
And my build.gradle (the compile section) is:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:support-v4:19.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.3.2'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.3.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
//compile 'com.github.mrengineer13:snackbar:0.4.0'
//compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:appcompat-v7:21.0.+'
//compile 'com.android.support:cardview-v7:21.0.+'
//compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.pnikosis:materialish-progress:1.0'
}
I've read in some others questions that it depends on two dependencies that share the same classes from v4, but I can't figure out which ones.
I'll hope someone can help.
First, try to update your jacksons versions your are using from 2.3.2 to 2.4.0.
Here is your new code:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:support-v4:19.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.4.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.0'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
//compile 'com.github.mrengineer13:snackbar:0.4.0'
//compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:appcompat-v7:21.0.+'
//compile 'com.android.support:cardview-v7:21.0.+'
//compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.pnikosis:materialish-progress:1.0'
}
It compile for me.

Categories

Resources