Google App Engine Gradle Dependency Conflict - android

I'm facing a problem with my dependencies in my app that will not let me add my endpoints-backend module as a dependency to my app module like so:
When I compile, it gives me this error:
Error:Execution failed for task ':app:preDexDebug'. >com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
When I remove the endpoints-backend dependency, the program runs, but I need it as a dependency so I can access the endpoints code inside my MainActivity.
Here's my Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.blume.android"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(path: ':endpoints-backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(path: ':cloud-backend', configuration: 'android-endpoints')
compile 'javax.persistence:persistence-api:1.0'
compile project(':endpoints-backend')
}
All Help is appreciated!

You should remove this line:
compile project(':endpoints-backend')
You have it included here:
compile project(path: ':endpoints-backend', configuration: 'android-endpoints')

Related

Persistent error -Execution failed for task ':app:transformClassesWithJarMergingForDebug'

I am trying to add microsoft azure mobile services to my existing android app. After adding the .jar files in my folder. I am getting error:
Execution failed for task
':app:transformClassesWithJarMergingForDebug.
For various file like annotation.class, Gson$5.class and as you can see in the error file it shows ApiJsonOperationCallback.class.
I have tired a lot of things(such as ./gradlew clean and ./gradlew clean assemble) but have been running into deadends everywhere.
This is my gradle file
apply plugin: 'com.android.application'
android {compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.jino.navigationplacepicker"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
defaultConfig {
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
jcenter()
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-javadoc.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-sources.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/gson-2.2.2.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/guava-17.0.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3.jar')
}
And this is the error message
:app:compileDebugNdk UP-TO-DATE :app:compileDebugSources
:app:transformClassesWithJarMergingForDebug FAILED Error:Execution
failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
com/microsoft/windowsazure/mobileservices/ApiJsonOperationCallback.class
:app:compileDebugJavaWithJavac Note: Some input files use or override
a deprecated API. Note: Recompile with -Xlint:deprecation for details.
Information:BUILD FAILED
Request you to please into this, and respond in layman terms as i am new to this.
The libraries are referenced twice in the gradle file causing them to conflict with each other.
The following lines are not needed.
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-javadoc.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-sources.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/gson-2.2.2.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/guava-17.0.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3.jar')
The following line will download and reference the needed binaries for Azure Mobile Services.
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
Here is a copy of a gradle file for a working Android application.
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.yourapp"
minSdkVersion 8
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
flatDir {
dirs 'aars'
}
}
}
dependencies {
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.guava:guava:18.0'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
}

Error in compile SDK version?

Can anyone please tell me how do i fix this error:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.example.abhishek.detector"
minSdkVersion 10
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
}
Error:
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\hp-pc\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1
Install the latest version of the build tools. Adjust your build.gradle to use
`buildToolsVersion "23.0.2"`
or check and remove duplicate dependencies from list.
Enjoy :)
Change the sdk version from the values/string.xml

Android : Error:Execution failed for task ':app:processDebugResources' exit with non-Zero Value 1

Am getting error when I rebuild the project. After I add the dependency for the google Map V2 this error occur.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
Process 'command 'C:\Users\Binil\AppData\Local\Android\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1
I tried to clean the project and rebuild the project but same issue occur again. Also I try sync the project but not solved
compile 'com.google.android.gms:play-services:8.4.0'
When I remove this dependency then app build successfully.
Gradle.build
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.android4dev.navigationview"
minSdkVersion 15
targetSdkVersion 22
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.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.google.android.gms:play-services:8.4.0'
}
Can any one please help me.
Add this with-in android tag to your module build.gradle:
dexOptions {
javaMaxHeapSize "4g"
}
Also, if you only want to use maps try to add this
compile 'com.google.android.gms:play-services-maps:8.4.0'
Instead of
compile 'com.google.android.gms:play-services:8.4.0'
Add apply plugin com.google.gms.google-services after dependencies
dependencies
{
compile 'com.google.android.gms:play-services:8.4.0'
}
apply plugin: 'com.google.gms.google-services'

com.android.build.transform.api.TransformException with android google play services

I'm trying to integrate Google Plus in my application, and it showing following error. below are exception and gradle
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "xxx.com.xxxx"
multiDexEnabled true
minSdkVersion 15
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
//depend-materialcalendar
compile 'com.prolificinteractive:material-calendarview:0.8.1'
compile 'com.android.support:gridlayout-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.melnykov:floatingactionbutton:1.3.0'
//depend-cometchat
compile 'com.yalantis:contextmenu:1.0.4'
compile 'com.google.code.gson:gson:2.3'
compile files('libs/appcompat_v7.jar')
compile files('libs/cometchat-sdk.jar')
compile files('libs/jsoup-1.7.3.jar')
compile files('libs/picasso-2.5.2.jar')
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-base:8.1.0'
compile 'com.google.android.gms:play-services-maps:8.1.0'
compile files('libs/volley.jar')
compile files('libs/PayPalAndroidSDK.jar')
compile files('libs/gcm.jar')
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
}
project build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.4.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Try cleaning your project and then re-building.
Try adding multiDexEnabled true in your app build.gradle file.
defaultConfig {
multiDexEnabled true
}
I have added this on the Application class:
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
In my app build.grade file:
defaultConfig {
applicationId "com.example.android.exampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
and added this as dependency:
compile 'com.android.support:multidex:1.0.0'
This solved my problem. Thanks
I just had the same problem in my current project when I moved the Android Gradle Plugin Version from 1.3.0 to 1.5.0.
The error was nearly the same one as the error of the OP except that java returned error code 2.
If finally turned out that I had the same jar file included in two different modules of the app.
Version 1.3.0 could handle this without problems, for version 1.5.0 I had to replace the jar files with a dependency for a separate module that contained a single copy of the jar file.
I have tried with adding
multiDexEnabled true
but did not work. then I have changed my build version from 23.0.2 to
buildToolsVersion "23.0.3"
then it works. hope it may help you.
try to add these line in your gradle
dexOptions {
javaMaxHeapSize "4g"
}

Picasso causes Execution failed for task ':app:dexDebug'

I'm using Android studio and I'm trying to add Picasso library to my project, but whenever I try to run the app I'm having this error
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Here is my Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
//TODO::Update to the latest version of Play Service
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.lorentzos.swipecards:library:1.0.8'
compile 'com.android.support:support-v4:22.0.0'
compile 'ch.halarious:halarious-core:0.11'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.soundcloud.android:android-crop:0.9.10#aar'
compile 'de.hdodenhof:circleimageview:1.2.2'
compile 'commons-io:commons-io:2.0.1'
compile 'com.integralblue:httpresponsecache:1.0.0'
compile 'com.koushikdutta.ion:ion:2.1.3’
//Here is the Picasso compile line
compile 'com.squareup.picasso:picasso:2.3.3'
}
I' using the latest version of JDK for Mac "jdk-8u45-macosx-x64". BTW, I have tried those solutions (Clean, Build, restart) so no need to suggest them
Thanks in advance
May you are facing the 65k method limit problem.
https://developer.android.com/tools/building/multidex.html
please put this in your default Config:
default Config {
minSdkVersion 14
targetSdkVersion 21
// Enabling multidex support.
multiDexEnabled true
}
and try again

Categories

Resources