Error:Execution failed for task ':app:transformClassesWithDexForDebug' in android studio -
i moving projects eclipse android studio. while running 1 of app following error. not able find solution. have enabled multidex well.
error:execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: java.lang.runtimeexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: 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 non-zero exit value 1
also gradle file below
apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.3" defaultconfig { applicationid "com.myapp" minsdkversion 9 targetsdkversion 21 multidexenabled true }buildtypes { release { minifyenabled true proguardfiles getdefaultproguardfile('proguard- android.txt'), 'proguard-project.txt', 'proguard-google-api-client.txt' } } } dependencies { compile 'com.android.support:support-v4:23.4.0' compile 'com.google.android.gms:play-services:+' compile 'com.google.http-client:google-http-client-gson:1.20.0' compile 'com.google.code.gson:gson:2.1' compile 'com.android.support:appcompat-v7:23.4.0' compile files('libs/activation.jar') compile files('libs/additionnal.jar') compile files('libs/android-support-v7-cardview.jar') compile files('libs/android-support-v7-recyclerview.jar') compile files('libs/commons-logging-1.1.1.jar') compile 'com.google.api-client:google-api-client:1.18.0-rc' compile 'com.google.api-client:google-api-client-android:1.18.0-rc' compile 'com.google.api-client:google-api-client-appengine:1.18.0-rc' compile 'com.google.http-client:google-http-client:1.18.0-rc' compile 'com.google.http-client:google-http-client-android:1.18.0-rc' compile 'com.google.http-client:google-http-client-appengine:1.18.0-rc' compile 'com.google.oauth-client:google-oauth-client:1.18.0-rc' compile 'com.google.oauth-client:google-oauth-client-appengine:1.18.0-rc' compile files('libs/google-api-client-gson-1.18.0-rc.jar') compile files('libs/google-api-client-jackson2-1.18.0-rc.jar') compile files('libs/google-api-client-java6-1.18.0-rc.jar') compile files('libs/google-api-client-servlet-1.18.0-rc.jar') compile files('libs/google-http-client-jackson2-1.18.0-rc.jar') compile files('libs/google-http-client-jdo-1.18.0-rc.jar') compile files('libs/google-oauth-client-java6-1.18.0-rc.jar') compile files('libs/google-oauth-client-jetty-1.18.0-rc.jar') compile files('libs/google-oauth-client-servlet-1.18.0-rc.jar') compile files('libs/graphview-4.0.1.jar') compile files('libs/httpclient-4.0.1.jar') compile files('libs/httpcore-4.0.1.jar') compile files('libs/jackson-core-2.1.3.jar') compile files('libs/jetty-6.1.26.jar') compile files('libs/jetty-util-6.1.26.jar') compile files('libs/jsr305-1.3.9.jar') compile files('libs/jxl.jar') compile files('libs/mail.jar') compile files('libs/transaction-api-1.1.jar') }
error:execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: java.lang.runtimeexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: 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 non-zero exit value 1
the upper error occure due lot of reason. can put why error occure , how solve it.
reason 1 : duplicate of class file name
solution :
when refactoring of of class files library project. , time write name of class file so, double check not have duplicate names
reason 2 : when have lot of cache memory
solution :
sometime if have lot of cache memory error occure solve it. go file/invalidate caches / restart
select invalidate , restart
clean cache memory.
reason 3 : when there internal bug or used beta version switch stable version.
solution :
solution simple go build menu , click clean project
, after cleaning click rebuild project
.
reason 4 : when memory of system configuration low.
solution :
open task manager , stop other application not used @ time free space , solve outofmemory
.
reason 5 : problem method count has exceed 65k.
solution :
open project build.gradle
file add
defaultconfig { ... multidexenabled true }
and in dependencies add below line.
dependencies { compile 'com.android.support:multidex:1.0.0' }
Comments
Post a Comment