dimanche 8 mars 2015

Android Studio unable to resolve error ':app:preDexDebug'



I'm just moving on from Eclipse to the intimidating Android Studio and have trouble getting rid of, what appears to be a fairly common error.



Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 1


I looked all over and have tried various solutions ranging from simply restarting my Studio, Invalidating and clearing the cache, removing the JARs and trying to add them again, but so far nothing works. I'm very new to this IDE so I'm not even sure how it works and what the build files are supposed to look like.


Here's my current build.gradle (Module:app)



apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.example.culami"
minSdkVersion 21
targetSdkVersion 21
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

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

dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/WebSocket.jar')
compile files('libs/android-support-v13.jar')
compile files('libs/json-org.jar')
compile files('libs/socketio.jar')
}


The project was imported from Eclipse and the reason for doing so was that I was facing some build issues with json-org.jar and WebSocket.jar. I wasn't able to fix this and the issue is still open. I'm not sure how do add these dependencies via gradle because the github page doesn't really say how.


Any help on how to fix this preDexDebug error will be a great help! As a side note, I'm also not able to see my 'libs' folder in the project explorer on the left.




Aucun commentaire:

Enregistrer un commentaire