-1

My gradle file code is here.

 apply plugin: 'com.android.application' android {
     compileSdkVersion 23
     buildToolsVersion "23.0.1"

     defaultConfig {
         applicationId "com.preciseit.trackusdown"
         minSdkVersion 14
         targetSdkVersion 23


     }

     buildTypes {
         release {
             minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
         }
     } } dependencies {
     compile files('libs/activation.jar')
     compile files('libs/additionnal.jar')
     compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar')
     compile files('libs/mail.jar')
     compile project(":library")    // compile project(":backend")    // compile 'com.nineoldandroids:library:2.4.0'


     compile 'com.android.support:appcompat-v7:23.1.1'
     compile 'com.android.support:support-v4:23.1.1'
     //compile 'com.daimajia.androidanimations:library:1.0.3@aar'
     compile 'com.android.support:recyclerview-v7:23.1.1'
     compile 'com.google.android.gms:play-services:8.1.0'
     compile 'com.squareup.retrofit:retrofit:1.9.0'
     compile 'com.loopj.android:android-async-http:1.4.9'    // compile 'com.squareup.picasso:picasso:2.5.2'
     //compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'

 }

Error is :

Information:Gradle tasks 
[:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] :app:preBuild 
UP-TO-DATE :app:preDebugBuild 
UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild 
UP-TO-DATE :library:compileLint :library:copyReleaseLint 
UP-TO-DATE :library:preBuild 
UP-TO-DATE :library:preReleaseBuild 
UP-TO-DATE :library:checkReleaseManifest :library:preDebugAndroidTestBuild 
UP-TO-DATE :library:preDebugBuild 
UP-TO-DATE :library:preDebugUnitTestBuild 
UP-TO-DATE :library:preReleaseUnitTestBuild 
UP-TO-DATE :library:prepareComAndroidSupportSupportV42221Library 
UP-TO-DATE :library:prepareReleaseDependencies :library:compileReleaseAidl \n
UP-TO-DATE :library:compileReleaseRenderscript 
UP-TO-DATE :library:generateReleaseBuildConfig 
UP-TO-DATE :library:generateReleaseAssets 
UP-TO-DATE :library:mergeReleaseAssets 
UP-TO-DATE :library:generateReleaseResValues 
UP-TO-DATE :library:generateReleaseResources 
UP-TO-DATE :library:mergeReleaseResources 
UP-TO-DATE :library:processReleaseManifest 
UP-TO-DATE :library:processReleaseResources 
UP-TO-DATE :library:generateReleaseSources 
UP-TO-DATE :library:processReleaseJavaRes 
UP-TO-DATE :library:compileReleaseJavaWithJavac 
UP-TO-DATE :library:extractReleaseAnnotations 
UP-TO-DATE :library:mergeReleaseProguardFiles 
UP-TO-DATE :library:packageReleaseJar 
UP-TO-DATE :library:compileReleaseNdk 
UP-TO-DATE :library:packageReleaseJniLibs 
UP-TO-DATE :library:packageReleaseLocalJar 
UP-TO-DATE :library:packageReleaseRenderscript 
UP-TO-DATE :library:packageReleaseResources 
UP-TO-DATE :library:bundleRelease 
UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72311Library 
UP-TO-DATE :app:prepareComAndroidSupportMediarouterV72220Library 
UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72311Library 
UP-TO-DATE :app:prepareComAndroidSupportSupportV42311Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServices810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAds810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesAppstate810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBasement810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesCast810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesDrive810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesFitness810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGames810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesLocation810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMaps810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesNearby810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPanorama810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesVision810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWallet810Library 
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesWearable810Library 
UP-TO-DATE :app:prepareTrackerFinalLibraryUnspecifiedLibrary 
UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl 
UP-TO-DATE :app:compileDebugRenderscript 
UP-TO-DATE :app:generateDebugBuildConfig 
UP-TO-DATE :app:generateDebugAssets 
UP-TO-DATE :app:mergeDebugAssets 
UP-TO-DATE :app:generateDebugResValues 
UP-TO-DATE :app:generateDebugResources 
UP-TO-DATE :app:mergeDebugResources 
UP-TO-DATE :app:processDebugManifest 
UP-TO-DATE :app:processDebugResources 
UP-TO-DATE :app:generateDebugSources 
UP-TO-DATE :app:preDebugAndroidTestBuild 
UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl 
UP-TO-DATE :app:processDebugAndroidTestManifest 
UP-TO-DATE :app:compileDebugAndroidTestRenderscript 
UP-TO-DATE :app:generateDebugAndroidTestBuildConfig 
UP-TO-DATE :app:generateDebugAndroidTestAssets 
UP-TO-DATE :app:mergeDebugAndroidTestAssets 
UP-TO-DATE :app:generateDebugAndroidTestResValues 
UP-TO-DATE :app:generateDebugAndroidTestResources 
UP-TO-DATE :app:mergeDebugAndroidTestResources 
UP-TO-DATE :app:processDebugAndroidTestResources 
UP-TO-DATE :app:generateDebugAndroidTestSources 
UP-TO-DATE :app:processDebugJavaRes 
UP-TO-DATE :app:compileDebugJavaWithJavac 
UP-TO-DATE :app:compileDebugNdk 
UP-TO-DATE :app:compileDebugSources 
UP-TO-DATE :app:preDexDebug warning: Ignoring InnerClasses attribute for an anonymous inner class 

(org.ksoap2.transport.KeepAliveHttpsTransportSE$1) that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an 
UP-TO-DATE compiler and without specifying any "-target" type options. The consequence of ignoring this warning is that reflective operations on this class will incorrectly indicate that it is *not* an inner class. :app:dexDebug UNEXPECTED TOP-LEVEL 

EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536   
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)     
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)  
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)    
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)    
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)     
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)  
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)  
at com.android.dx.command.dexer.Main.run(Main.java:277)     
at com.android.dx.command.dexer.Main.main(Main.java:245)    
at com.android.dx.command.Main.main(Main.java:106) Error:Execution failed for task ':app:dexDebug'.

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 with non-zero exit value 2 Information:BUILD FAILED Information:Total time:
50.233 secs Information:1 error Information:0 warnings Information:See complete output in console
Dhaval Patel
  • 10,119
  • 5
  • 43
  • 46
Ravindra Pawar
  • 477
  • 1
  • 5
  • 22

1 Answers1

1

You have problem of multidex file so please add below dependency to your app Gradle file.

compile 'com.android.support:multidex:1.0.1'

Also add this line:

defaultConfig {

    applicationId 'pkg'
    minSdkVersion 
    targetSdkVersion 
    versionCode 
    versionName 

    // Enable MultiDexing:  https://developer.android.com/tools/building/multidex.html
    multiDexEnabled true
}

Also add below in Manifest.xml :

<?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>

Edited :

Try the following:

  1. Change setting

Ctrl + Alt + S -> Compiler -> Gradle

InVM Options field write:

-Xmx2048m -XX:MaxPermSize=512m

  1. Add in gradle

dexOptions { javaMaxHeapSize "2g" }

Thanks..!!

AndiGeeky
  • 11,266
  • 6
  • 50
  • 66