believe that everyone in the Android development can not avoid to be integrated in the process of the third party after a project, integration, sometimes it will encounter this ash often hate transformClassesWithDexForDebug, detailed Log is as follows: span> p>
Error:Execution failed for task ':APP:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
The main reason for this problem is that the introduction of Libary overlaps with some Libs in existing projects. Please check in detail and make sure that there is only one copy of lib in use, such as v4, v7, utdid.jar, etc.
if you use other android’s official support library see, http://developer.android.com/tools/support-library/features.html
if there is still a problem after the above situation check, you can try to use the following configuration to solve the problem
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
//Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile ´com.android.support:multidex:1.0.1´
}
and then in the manifest we introduce this, if there is a custom AppApplication, let your own AppApplication inherit this class
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.multidex.myapplication">
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
</manifest>
may also be a JDK version 1.8 problem, which is not an accident, so suspect that Gradle has compatibility problems with JDK 1.8 and try to reduce the number of JDK dependencies to 1.7
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
can be run or there will be errors after the configuration is completed, so we can also add this sentence in app.bulid and re-run after that. The specific amount or 4g can be seen from the computer configuration modification (2g, 3g, 6g, 8g).
dexOptions {
javaMaxHeapSize "4g"
}
the above is the Error: I met in the Execution failed for task ‘: APP: transformClassesWithDexForDebug’ all solutions, sharing out hope to help everyone.
Read More:
- Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’
- Error:Execution failed for task ‘: app:transformDexArchiveWithExternalLibsDexMergerForDebug The solution
- Quick solution org.gradle.api . tasks.TaskExecutionException : Execution failed for task ‘: app:compileJava ‘
- Execution failed for task ‘:app:processDebugManifest’.
- Execution failed for task ‘:app:stripDebugDebugSymbols‘.
- Execution failed for task ‘:app:processDebugManifest’
- Execution failed for task ‘:app:mergeDebugResources’.
- To solve the execution failed for task ‘: app:transformDexArchiveWithDexMergerForDebug ‘
- Error:Execution failed for task’:app:processDebugResources’. Personally resolved
- Execution failed for task ‘:app:installDebug’.
- Android: How to Solve Execution failed for task ‘:app:compileDebugJavaWithJavac‘. > javax/xml/bind/JAXBException
- [solution] a perfect solution to the problem of failed to load module “Canberra GTK module” in Ubuntu
- Execution failed for task :Test:lintVitalRelease/Lint found fatal errors while assembling a release
- Error code 1 error resolution (NPX create react app my app execution reports an error)
- Laravel 500 server error, perfect solution
- Hive execution task report cannot find main class error
- Struts2 is cracked, a serious loophole, a perfect solution