4
votes

Execution failed for task :YAMSTestApp:preDexDebug.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.4.2\dx.bat --dex --output C:\Users\perlahc\Desktop\Android%20Experiments\Android\YAMSTestAppProject\YAMSTestApp\build\pre-dexed\debug\classes-d4be5d35ce11b5db92da330f37cb6b3bc675c142.jar C:\Users\perlahc\Desktop\Android%20Experiments\Android\YAMSTestAppProject\YAMSTestApp\build\exploded-bundles\ComAndroidSupportAppcompatV71901.aar\classes.jar Error Code: 1 Output: UNEXPECTED TOP-LEVEL EXCEPTION: java.io.FileNotFoundException: C:\Users\perlahc\Desktop\Android0Experiments\Android\YAMSTestAppProject\YAMSTestApp\build\exploded-bundles\ComAndroidSupportAppcompatV71901.aar\classes.jar (The system cannot find the path specified) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:215) at java.util.zip.ZipFile.(ZipFile.java:145) at java.util.zip.ZipFile.(ZipFile.java:159) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:596) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103) 1 error; aborting

Here is the build.gradle file

import groovy.io.FileType

buildscript {
   repositories {
    mavenCentral()
   }
 dependencies {
    classpath 'com.android.tools.build:gradle:0.7.+'
           }
}

apply plugin: 'android'

repositories {
    mavenCentral()
} 

android {
compileSdkVersion 19
buildToolsVersion "19.0.1"

defaultConfig {
    minSdkVersion 17
    targetSdkVersion 19
   }

 }


dependencies {
compile 'com.android.support:appcompat-v7:+'
}

preBuild.doFirst {

def protoc = file('../../../AppUtilities/bin/protoc.exe')
def outdir = file('src/main/java')
//outdir.deleteDir()
//outdir.mkdir()

file('../../../Libraries/YAMSLib').eachFileMatch (FileType.FILES, ~/.*\.proto/) { file ->
    exec {
        println 'generating java for '+file.name
        commandLine protoc.absolutePath, '"--java_out='+outdir.absolutePath+'"',    file.absolutePath, '"--proto_path='+file.getParentFile().absolutePath+'"'
    }
}

}
1

1 Answers

0
votes

Are you using jdk 1.7 U45??I was able to get around this problem after updating my java from 1.7 U45 to 1.7 u51 hope this helps

thanks