Error:Execution failed for task ':app:dexDebug' Android - android

Error when importing the project via git .I tried importing the project via git and executed the project and it gives me this error:
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
main:
compile 'com.android.support:design:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.ocpsoft:ocpsoft-pretty-time:1.0.6'
compile project(':facebook2')
compile 'jp.wasabeef:recyclerview-animators:1.2.0#aar'
compile 'jp.wasabeef:picasso-transformations:1.0.5'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okio:okio:1.0.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.nineoldandroids:library:2.4.0'
horizontal:
dependencies {
compile 'com.android.support:support-v4:18.+'
}
facebook:
dependencies {
compile 'com.android.support:support-v4:[21,22)'
compile 'com.parse.bolts:bolts-android:1.2.0'
}

You see where you have:
compile 'com.google.android.gms:play-services:7.5.0'
You are actually compiling all of Google's play services and that will often result in a mulidex error, meaning you have a whole lot of modules and code. It is best to only compile the API you need, for instance, if you want to use play service's location API just compile it this way:
compile 'com.google.android.gms:play-services-location:7.5.0'

Related

Facebook SDK causing 'appDebug' error android studio

I am trying to incorporate Facebook SDK , but Android Studio is giving me errors at compile time.
Here is my error:
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 2
Gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/gcm.jar')
compile files('libs/httpmime-4.1.1.jar')
compile files('libs/junit-4.10.jar')
compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/signpost-jetty6-1.2.1.1.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile project(':stripe')
compile project(':FacebookSDK')
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.specyci:residemenu:1.6+'
compile 'com.android.support:multidex:1.0.0'
}
But this doesn't work, and honestly isn't a good solution. When I remove facebook sdk, my app compiles no problem, but with it nothing works. What am I missing here?
You are over 64K methods in your build because of using so many libraries, enable multiDex, clear unused libraries, remove unused methods with ProGuard or whatever you want, but you have reached the method count limit for a single APK.

This: finished with non-zero exit value 2

Error:Execution failed for task ':app:dexMt_360Debug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
build.gradle in my project:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.joooonho:selectableroundedimageview:1.0.1'
compile project(':J2WBase')
compile 'com.facebook.react:react-native:0.17.1'
}
build.gradle in the third party framework:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.jakewharton:butterknife:6.1.0'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'commons-lang:commons-lang:2.6'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'de.greenrobot:eventbus:2.4.0'
}
I have tried to delete the build folder, re build project
Upgrade buildtools to the latest version
I think it might be a jar package duplicate reference problem, but I can't find a place to repeat, and what should I do next, since quoting'com.facebook.react:react-native:0.17.1 compile.

':app:dexDebug'. com.android.ide.common.process.ProcessException

If I add paypal sdk then I get this problem else my project is running successfully.
Can some tell me from which dependency it is conflicting?
Here are my dependencies...
compile 'com.android.support:support-v13:23.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile files('libs/PayPalAndroidSDK-2.11.1.jar'
I removed build files and rebuilt the project but no hope and strange part is I have one dummy project where I write code first, in that project everything working fine but here getting error always.
Paypal library includes GSON dependency and Retrofit too, you have to exclude the GSON dependency from retrofit.

How to resolve : more than one library with the package name com.google.android.gms in gradle

How to resolve this error while compiling google play service gcm and admob.
Error:Execution failed for task ':processDebugResources'.
Error: more than one library with package name 'com.google.android.gms'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0[enter image description here][1]
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.code.gson:gson:2.3'
compile "com.android.support:appcompat-v7:22.2.1"
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
This will probably vanish if you use the same version on both (7.8.0)
compile 'com.google.android.gms:play-services-gcm:7.8.0' // <- remove this line
compile 'com.google.android.gms:play-services:6.5.87'
There is already 8.1+ though.
Also:
Gcm is already in the play services, you can remove the whole line.

ExecException when adding the new support design library

I'm trying to add the new Support Design library to my project:
compile 'com.android.support:design:22.2.0'
But as soon as I try to compile, I get the following error:
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 3
I've already reached the 65k method limit a few libraries back, so I already added MultiDex support and solver that problem a while ago.
Here are all my dependencies, if it helps:
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile('com.crashlytics.sdk.android:crashlytics:2.2.2#aar') {
transitive = true;
}
compile 'com.helpshift:android-aar:3.8.0'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'com.google.code.gson:gson:2.3'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.loopj.android:android-async-http:1.4.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.github.kierans:ViewPagerIndicator:138e5f5bd9'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
compile 'pl.charmas.android:android-reactive-location:0.6#aar'
compile 'io.reactivex:rxjava:1.0.10'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
I know there are a lot of them, but I need them all.
You should consider changing your compile 'com.google.android.gms:play-services:7.5.0' dependency, and grab only a portion of the Play Services.
You can see the guide for it at https://developers.google.com/android/guides/setup#split , that will most likely solve your 65k issue as well.

Categories

Resources