buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'android'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':Q-municate_core')
compile project(':cropper')
compile project(':stickyListHeaders')
compile "com.nostra13.universalimageloader:universal-image-loader:${rootProject.universalImageLoaderVersion}"
compile "com.google.android.gms:play-services:7.5.0"
compile('de.keyboardsurfer.android.widget:crouton:1.8.4#aar') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile "com.nineoldandroids:library:${rootProject.nineoldandroidsVersion}"
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
compile 'com.crashlytics.android:crashlytics:1.+'
}
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode rootProject.versionCode
versionName rootProject.versionName
}
buildTypes {
release {
debuggable rootProject.prodDebug
signingConfig signingConfigs.debug
minifyEnabled false
proguardFile 'proguard.cfg'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
abortOnError false
}
}
This is my build.gradle file
I couldn't understand where I go wrong please help in this way.
when I compile this file I got the error
org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_72\bin\java.exe'' finished with non-zero exit value 2
I can't see your buildToolsVersion in the gradle. Have the latest build told version and also remove the unnecessary dependencies.
Follow this.
You added dependency in wrong gradle file. see here two types of gradle
add dependency in build.gradle(Module : app)
and for understanding its feature use this link
build.gradle(Module:app) have to be like this-->
and project gradle file have to be like this --->
if any dependency you want to add then add in build.gradle(app)
This error is all about you have many huge libraries. So your method count is higher than 65k. It makes your dex file is large. This is why you are taking a error while executing "dexDebug".
Solution is quite simple. You should implement Multidex.
It's because one of the libraries that you are adding contains a compile error.
try to remove each time one library and compile, you can know than which of them is causing the error.
I think you should start with nineoldandroids library.
Related
Today, I opened Android Studio, then I get this error. Yesterday, there was a no problem such that!
Error:Execution failed for task ':app:processDebugResources'.
Error: more than one library with package name 'com.google.android.gms.license'
com.google.android.gms:play-services-xxx libraries was
11.8.0
Onesignal library was
'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
Then I changed them to latest version.
Now App/Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 15
targetSdkVersion 24
versionCode 10
versionName 'x.x.x'
manifestPlaceholders = [onesignal_app_id: "xxxxx-xx-xxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "XXX"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
maven { url 'https://maven.google.com' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.google.android.gms:play-services-ads:12.0.0'
//compile 'com.google.android.gms:play-services-ads:11.2.2'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
//compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.balysv:material-ripple:1.0.2'
compile "com.google.firebase:firebase-messaging:12.0.0"
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
compile 'com.google.android.gms:play-services-analytics:12.0.0'
}
apply plugin: 'com.google.gms.google-services'
Project/Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.1'
// classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
But I am still getting same error that stated above. How can I solve this problem? Why did this problem occur Today when there was no problem, yesterday?
This probably because the play services version is not in the range defined for
OneSignal:[3.7.1, 3.99.99] which is (you can see it at this commit):
// Limit upper number (exclusive) to prevent untested versions
static def versionGroupOverrides = [
'com.google.android.gms': '[10.2.1, 11.7.0)',
'com.android.support': '[26.0.0, 27.1.0)'
]
So, try changing the play services version to 11.7.0.
You should try using OneSignal Gradle Plugin which helps make the OneSignal Android SDK compatible with your Android Studio project. Use OneSignal-Gradle-Plugin 0.8.0 for OneSignal:[3.7.1, 3.99.99]
each time I try to build an APK, this error keep showing !? I've tried almost all the soultoins mention on the site, but no luck!
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException:
java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class
My gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
lintOptions {
quiet true
abortOnError false
ignoreWarnings true
}
configurations {
all*.exclude group: 'commons-io'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'BinaryEncoder.java'
}
defaultConfig {
applicationId "com.xxxx.xxxxx"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.2"
multiDexEnabled true
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
sourceSets {
main {
java {
exclude 'com.twilio:client-android:1.2.18.org.apache.http.lejacy.jar.org.apache.BinaryEncoder.java'
exclude 'org.apache.commons.codec.BinaryEncoder.java'
}
}
androidTest {
java {
exclude 'commons-codec-1.10/**'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.twilio:client-android:1.2.18') {
exclude group: 'org.apache.commons', module: 'commons-io'
}
compile project(':example')
compile project(':zoomcommonlib')
compile project(':zoommobilertc')
compile("com.github.hotchemi:permissionsdispatcher:2.4.0") {
exclude module: "support-v13"
}
compile('com.stripe:stripe-android:4.1.5') {
transitive = true;
exclude group: 'com.google.code.gson', module: 'gson'
}
compile('com.squareup.retrofit:retrofit:1.9.0') {
transitive = true;
exclude group: 'com.google.code.gson', module: 'gson'
}
compile 'com.google.android.gms:play-services-gcm:11.2.0'
compile 'lib.kingja.switchbutton:switchbutton:1.1.3'
compile 'com.orhanobut:hawk:2.0.1'
compile 'com.afollestad:material-camera:0.4.4'
compile 'com.werb.pickphotoview:pickphotoview:0.3.0'
compile 'com.github.Kennyc1012:BottomSheet:2.3.4'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.google.android.gms:play-services-identity:11.2.0'
compile 'com.google.android.gms:play-services-plus:11.2.0'
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.paypal.sdk:paypal-android-sdk:2.14.4'
compile 'com.koushikdutta.ion:ion:2.1.8'
compile 'com.afollestad.material-dialogs:core:0.8.6.0'
compile 'com.amitshekhar.android:android-networking:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'
}
Here's some solutions that I've tried and did not work:
I've added those transitive = true; exclude group: 'com.google.code.gson', module: 'gson' forretrofitandstripe` dependencies
I deleted the gson dependency
I wanted to delete the jar file for gson library but I couldn't find it inside libs folder !?
multiDexEnabled true was already added and did no effect
I've deleted compile fileTree(dir: 'libs', include: ['*.jar'])
I think it has something to do with the Zoom module or with Stripe any help.. !?
You could try to get the dependency tree and figure out which package it is.
I figured it out, first.. thanks guys for ur help anyhow..! but I'm making this as the accepted answer since it's the one that worked out for me!
Step 1
I searched for the duplicated class in the whole project using (Double Shift)
and it showed me which library is also using the same class..! in my case it was zoommobilertc
Step 2
I tried excluding the gson module of that library like this:
compile project(':zoommobilertc'){
exclude group: 'com.google.code.gson', module: 'gson'
}
..but it didn't work, and it give me error that I think it has something to do with exclude . I tried a few solution but no luck!
So.. I did this instead ..
Open Project View
Open External Libraries
Find the library which's zoommobilertc and unfold its folder
Delete Gson jar file that shows.!
Step 3
After that, I synced the project and tried to build an apk, bu this error showed:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list E:\*****\*****\app\build\intermediates\multi-dex\debug\maindexlist.txt --output E:\*****\*****\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main E:\*****\*****\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
Then after searching I found a fix:
I added this inside build.gradle file within android section:
android{
//..
dexOptions {
javaMaxHeapSize "4g"
}
//..
}
..and this line inside local.properties file
org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
Done
Find out the dependency that causes above Error and exclude gson
as follows from your dependency,
compile ('your_dependency'){
exclude group : 'com.google.code.gson'
}
In android studio terminal execute
./gradlew clean
and perform the following and rebuild
Try adding this to your dependencies
compile'com.android.support:multidex:1.0.1'
and in manifest add this
android:name="android.support.multidex.MultiDexApplication"
in the application tag
I had my gson.jar in my libs folder.
I fixed my duplicate entries by retaining the line below:
implementation fileTree(dir: "libs", include: ["*.jar"])
And deleting this entry here:
implementation 'com.google.code.gson:gson:2.8.7'
This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Closed 5 years ago.
I have just created a new Android Studio project for both Android Mobile and wear. The initial gradle build failed because I am getting several errors-
Error: Failed to resolve: com.android.support:support-v4:26.0.0
Error: Failed to resolve: com.android.support:percent:26.0.0
Error: Failed to resolve: com.android.support:recyclerview-v7:26.0.0
Error: Failed to resolve: com.android.support:support-annotations:26.0.0
With each error, I am given the option to Install repository and sync project, but nothing happens when I click on it. I have spent several hours trying to find why I am getting these errors, but I can't find any solutions. Does anybody know how to fix these very frustrating errors? Thank you!
build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (mobile)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:appcompat-v7:26+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.android.support:support-core-utils:26+"
testCompile 'junit:junit:4.12'
}
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.androidweartest"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile "com.android.support:support-core-utils:26+"
}
I am sure that my version of Android Studio is updated, and all support repositories and APIs are installed.
I don't have an Android wear project, but I had the same problem when I wanted to upgrade the Support Library version for an existing project to 26.0.0. Since 26.0.0 the support libraries are available through Google's Maven repository. So I had to add the repository to my build. gradle file.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Check out https://developer.android.com/topic/libraries/support-library/setup.html for more details.
The following worked for me:
In the Application build.gradle considered to add following:
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
}
}
in the Module build.gradle:
compileSdkVersion 26
buildToolsVersion "26.0.1"
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.android.support:support-compat:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-annotations:26.0.1'
compile 'com.android.support:support-vector-drawable:26.0.1'
compile 'com.android.support:animated-vector-drawable:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v13:26.0.1'
compile 'com.android.support:percent:26.0.1'
compile 'com.android.support:wear:26.0.1'
compile 'com.google.android.support:wearable:2.0.4'
provided 'com.google.android.wearable:wearable:2.0.4'
}
Either change your build tool version from 26.0.1 to 26.0.0 or you can replace 26.0.0 by 26.+ like below.
compile 'com.android.support:support-v4:26.0.0'
to
compile 'com.android.support:support-v4:26.+"
Do same with all...
Hope it helps.
Happy Coding! ^_^
For now, I fixed this with changing in the wear build.gradle:
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
It seems like the problem is com.google.android.support:wearable:2.0.4. With that, Using 26.0.1 build tools compiles fine. I haven't gone any further with this but it looks like a dependency problem related to a repository although that is really just a guess from the error messages.
Add the following dependencies in your app/build.gradle.
repositories {
maven { url 'https://maven.fabric.io/public' }
maven{url 'https://maven.google.com'}
}
Replace this:
compile 'com.android.support:recyclerview-v7:26.0.0'
With this
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
Do same with all
Update - new version released
compile 'com.android.support:recyclerview-v7:26.1.0'
Add following dependency in your gradle
Replace
compile 'com.android.support:support-v4:26.0.0'
with
compile 'com.android.support:support-v4:25.0.0'
and Replace
compile 'com.android.support:appcompat-v7:26+'
with
compile 'com.android.support:appcompat-v7:25.0.0'
The reason that my project was giving me these errors was because I created the project for Android Platform 26. However, Wear currently doesn't support 26, and it is essential to change the target and compile SDK versions to 25 in the wear module of build.gradle.
Link to Android Developers documentation - https://developer.android.com/training/wearables/apps/creating.html#setting-up-a-phone
build.gradle (wear)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.georgeberdovskiy.findmyphone"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:2.0.3'
provided 'com.google.android.wearable:wearable:2.0.3'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
I only needed to change the compile and target SDK versions to 25 in the wear module. I left them as 26 for the mobile module.
This one worked for me
allprojects {
repositories {
jcenter()
google()
}
}
google() does the magic with the following configuration
Studio version : 3.0 beta 2
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
I meet this problem, changing the build tool/ sdk version didn't work, clearly write compile version didn't work, off line build didn't work.
Finally I just change wearable version, and this problem gone.
provided 'com.google.android.wearable:wearable:2.0.4'
compile 'com.google.android.support:wearable:2.0.4'
to
provided 'com.google.android.wearable:wearable:2.0.2'
compile 'com.google.android.support:wearable:2.0.2'
By the way, I used offline building now because it is really fast when I check this issue.
Ok, i know this topic is in stack overflow already, but i did everything i could, i did the multydex thing in my gradle, i did every answer i tried to get at stackoverflow, now i need really help on this, yesterday i was unable to run my app after 3 hs of trying to resolve this, hope you guys can bring me a hand
here is my app gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "myproject.myname.com.myapp"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-storage:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.firebaseui:firebase-ui-database:0.4.4'
compile 'com.squareup.picasso:picasso:2.5.2'
}
apply plugin: 'com.google.gms.google-services'
here is my project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
if i try to add the multidex = true and all the multiplex lines i got this error
Error:Execution failed for task ':app:packageAllReleaseClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzajj.class
im really confused and i cant find the answer since yesterday , if someone can help me i will be so glad, thanks
UPDATE
Ok , it seems the firebase compiles were causing the problem for the java jdk value error
after changing it to version 9.4.0 it worked
Change ffirebase:firebase-storage ,'com.google.firebase:firebase-database:9.0.0','`com.google.firebase:firebase-auth:' version to 9.4.0 rather than 9.0.0
Let me know if this works for you .
I am still using Android Studio 0.8.9 on my Macbook Air. On my iMac i installed Android Studio 1.0.
As 1.0 only supports 'com.android.tools.build:gradle:1.0.0' i had to change my build.gradles
as mentioned here. Gradle DSL method not found: 'runProguard'
0.8.9 uses 'com.android.tools.build:gradle:0.12.2'
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example...."
minSdkVersion 19
targetSdkVersion 20
versionCode 1
versionName "0.87"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
preDexLibraries = false
} }
repositories {
mavenCentral()
flatDir {
dirs 'libs'
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:support-v4:20.0.+'
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.spotify.sdk:spotifysdk:1.0.0-beta6#aar'
compile('se.michaelthelin.spotify:spotify-web-api-java:1.4.20')
}
With the 0.8.9 beta on my MacBook Air my App builds fine. On my iMac i get this error.
org.apache.commons.collections.ArrayStack has already been added to output. Please remove duplicate copies.
UPDATE
The problems seems to be that commons-collections is added to the external libraries and commons-beanutils which also includes a commons-collections.
compile('se.michaelthelin.spotify:spotify-web-api-java:1.4.20') {
exclude group: "commons-beanutils", module: "commons-beanutils"
}
if i exclude the commons-beanutils the build process is fine, but the app crashes, as it needs the commons-beanutils. same if i exclude the commons-collections.
furthermore i tried to manually remove the folder common-collections from the commons-beanutils jar, but this also does not work..
finally it works.
this one does not include commons-collections, so everything works fine.
compile 'commons-beanutils:commons-beanutils:20030211.134440'
don't understand why this was not necessary in beta 0.8.9
compile('se.michaelthelin.spotify:spotify-web-api-java:1.4.20') {
exclude group: "commons-beanutils", module: "commons-beanutils"
}
compile 'commons-beanutils:commons-beanutils:20030211.134440'
Try:
project > clean
project > rebuild
and run again