Roga Men
Roga Men

Reputation: 520

Compiling Android Project

What is wrong? I can't compile project and get error:

Error:Execution failed for task ':app:transformClassesWithDexForGoogleDebug'.

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 --multi-dex --main-dex-list C:\Users\andre\Desktop\MYproject\app\build\intermediates\multi-dex\google\debug\maindexlist.txt --output C:\Users\andre\Desktop\MYproject\app\build\intermediates\transforms\dex\google\debug\folders\1000\1f\main C:\Users\andre\Desktop\MYproject\app\build\intermediates\transforms\jarMerging\google\debug\jars\1\1f\combined.jar}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.firebase-perf'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId "com.gvarani.myproject"
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 15
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true //important

    }
    useLibrary 'org.apache.http.legacy'
    signingConfigs {
        release
    }
    buildTypes {
        debug {
            minifyEnabled false
            shrinkResources false

        }
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    getDefaultProguardFile('proguard-android-optimize.txt'),
                    'proguard/proguard-project.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    flavorDimensions "release"
    productFlavors {
        google {
            dimension "release"
        }

        other {
            dimension "release"
        }
    }

    dexOptions {
        javaMaxHeapSize "2g"
        jumboMode true
    }
}

ext {
    supportLibVersion = '26.0.0'
    gmsVersion = '11.0.4'
}

dependencies {
    googleCompile "com.google.firebase:firebase-crash:${gmsVersion}"
    googleCompile "com.google.firebase:firebase-messaging:${gmsVersion}"
    googleCompile "com.google.firebase:firebase-auth:${gmsVersion}"
    googleCompile 'com.anjlab.android.iab.v3:library:1.0.42'
    compile "com.android.support:appcompat-v7:${supportLibVersion}"
    compile "com.android.support:cardview-v7:${supportLibVersion}"
    compile "com.android.support:design:${supportLibVersion}"
    compile "com.android.support:customtabs:${supportLibVersion}"
    compile "com.google.firebase:firebase-perf:${gmsVersion}"
    compile "com.google.firebase:firebase-database:${gmsVersion}"
    compile "com.google.firebase:firebase-ads:${gmsVersion}"
    compile 'com.firebaseui:firebase-ui-auth:2.2.0'
    compile 'com.firebaseui:firebase-ui-database:2.2.0'
    compile 'com.google.code.gson:gson:2.8.1'
    compile 'dev.dworks.libs:volleyplus:0.1.4'
    compile 'cat.ereza:customactivityoncrash:2.1.0'
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
    compile 'org.fabiomsr:moneytextview:1.1.0'
    compile 'com.zsoltsafrany:needle:1.0.0'
    compile 'com.github.lykmapipo:local-burst:v0.2.0'
    compile 'com.github.javiersantos:AppUpdater:2.6.1'
    compile 'de.psdev.licensesdialog:licensesdialog:1.8.2'
    compile 'org.jsoup:jsoup:1.10.3'
    compile 'com.wordplat:ikvStockChart:0.1.5'
    compile 'com.android.support:multidex:1.0.0'
    //Kotlin dependencies
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}

apply plugin: 'com.google.gms.google-services

Upvotes: 1

Views: 382

Answers (5)

Malav Shah
Malav Shah

Reputation: 482

Add maven { url "https://maven.google.com" } in Project level gradle

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Upvotes: 0

Naveen Kumar M
Naveen Kumar M

Reputation: 7557

Add below lines to your app build.gradle

 buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            }

        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }

Upvotes: 0

user8437750
user8437750

Reputation:

Please try below code

android{
defaultConfig {

    // Enabling multidex support.
    multiDexEnabled true
}


dexOptions {
    javaMaxHeapSize "4g"
}
}
dependencies {
//...
 compile 'com.android.support:multidex:1.0.0'
  }

**Hope this will help **

Upvotes: 1

Praful Patel
Praful Patel

Reputation: 219

add follow code in your manifest.xml file:

 <application
 android:name="android.support.multidex.MultiDexApplication">
 </application>

Upvotes: 0

Vishal Vaishnav
Vishal Vaishnav

Reputation: 3422

Put below line in build.gradle;

multiDexEnabled true 

like this:

defaultConfig 
  {
    applicationId "yourProjectPackage"
    minSdkVersion 15
    versionCode 1
    versionName "1.0"
    targetSdkVersion 23

    multiDexEnabled true //important
    }

Upvotes: 0

Related Questions