0

My Android Studio is 2.3 Version. I am attempting to run the code but the app fails with the following errors, not sure what the problem is.

Here is the error:

Error:Execution failed for task ':app:transformClassesEnhancedWithInstantReloadDexForDebug' com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --force-jumbo --num-threads=4 --output C:\project\app\build\intermediates\reload-dex\debug C:\project\app\build\intermediates\reload-dex\debug\classes.jar}

build.gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.ucmedia.project"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        apply plugin: 'com.android.application'
        multiDexEnabled true
        }
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }}
dexOptions {
    preDexLibraries false
    javaMaxHeapSize "4g"
    jumboMode true
}}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
    {exclude group: 'com.android.support', module: 'support-annotations'})
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    compile 'com.android.support:design:25.2.0'
    testCompile 'junit:junit:4.12'
}

I tried the following but the error still happens:

  • Clean and Rebuild the project
  • Re-imported the project as an external source into Android Studio.
  • Delete all jar and lib files from build directory.
  • Remove folder .gradle .idea folder.
  • Upgrading / Downgrade gradle / sdk.
  • Check for any duplicates of the support library in app.iml file.
  • Add multidex support.
halfer
  • 19,824
  • 17
  • 99
  • 186
ucMedia
  • 4,105
  • 4
  • 38
  • 46

2 Answers2

1

Try to change compile 'com.google.android.gms:play-services:8.1.0'

0

Adding the following code to 'build.gradle' app module solved my problem:

dependencies {
    ...
    compile 'com.android.support:multidex:1.0.0'
    ...
}
sth
  • 222,467
  • 53
  • 283
  • 367
ucMedia
  • 4,105
  • 4
  • 38
  • 46