android - Persistent error -Execution failed for task ':app:transformClassesWithJarMergingForDebug' -
i trying add microsoft azure mobile services existing android app. after adding .jar
files in folder. getting error:
execution failed task ':app:transformclasseswithjarmergingfordebug.
for various file annotation.class
, gson$5.class
, can see in error file shows apijsonoperationcallback.class
. have tired lot of things(such ./gradlew clean , ./gradlew clean assemble) have been running deadends everywhere.
this 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 error message
:app:compiledebugndk up-to-date :app:compiledebugsources :app:transformclasseswithjarmergingfordebug failed error:execution failed task ':app:transformclasseswithjarmergingfordebug'. com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: com/microsoft/windowsazure/mobileservices/apijsonoperationcallback.class :app:compiledebugjavawithjavac note: input files use or override deprecated api. note: recompile -xlint:deprecation details. information:build failed
request please this, , respond in layman terms new this.
the libraries referenced twice in gradle file causing them conflict each other.
the following lines 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 download , reference needed binaries azure mobile services.
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'
here copy of gradle file 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' }
Comments
Post a Comment