0

I already know that question has been already asked very often and answers, but no one of the answers i found fixed my problem.

It's the error:

  Information:Gradle tasks [:app:assembleDebug]
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
   :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
  :app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE
  :app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
  :app:prepareComAndroidSupportSupportVectorDrawable2321Library 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:compileDebugJavaWithJavac
  :app:compileDebugNdk UP-TO-DATE
  :app:compileDebugSources
  :app:transformClassesWithDexForDebug
  UNEXPECTED TOP-LEVEL EXCEPTION:
  Error:com.android.dx.cf.iface.ParseException: bad class file magic         (cafebabe) or version (0034.0000)
 at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at  com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClas sFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
at com.android.dx.command.dexer.Main.processClass(Main.java:749)
... 12 more

1 error; aborting Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

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 1

my gradle

 apply plugin: 'com.android.application'

 android {
     compileSdkVersion 23
     buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "ppp.i2e.org.mppconversion"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

compileOptions {
    sourceCompatibility = 1.7
    targetCompatibility = 1.7//JavaVersion.VERSION_1_7
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    //compile 'net.sf.mpxj:mpxj:5.2.2'
    //compile files('libs/mpxj.jar')
    compile files('libs/MPPConverterJAR.jar')
}
siddhesh
  • 563
  • 1
  • 9
  • 15

1 Answers1

0

Try to add java compatibility using this way i.e. File-> Project structure-> click on your module name-> open properties tab on top of that->change the source and target compatibility. Hope this will work. And remove compile options from gradle file. and add vector compatibility if you are using gradle plugin 2.0+

android {  
    defaultConfig {  
        vectorDrawables.useSupportLibrary = true  
    }  
}  
A. Badakhshan
  • 1,045
  • 7
  • 22
brahmy adigopula
  • 617
  • 3
  • 15