Execution failure in Android Studio (Error:Execution failed for task ':app:preDexDebug'.)

Asked

Viewed 401 times

0

In the execution of my project is occurring the error below and I have already searched in several places, but none fixed for my problem. I hope someone can help me.

I’ve restarted Android Studio and gave a Clean, but nothing worked.

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

com.android.ide.common.process.Processexception: org.gradle.process.internal.Execexception: Process 'command 'C: Program Files Java jdk1.8.0_45 bin java.exe'' finished with non-zero Exit value 1

build.Gradle ( app):

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.example.junior.fireflyapp"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

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

dependencies {
     compile 'com.android.support:appcompat-v7:23.1.0'
     compile 'mysql:mysql-connector-java:5.1.37'
     compile 'com.android.support:design:23.1.0'
}

build.Gradle ( project):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
         jcenter()
    }
}
  • Good evening, edit the question and put the code on it, I recommend you read: http://answall.com/help/mcve

  • @Mauricio Junior, could you attach to your question the code of your build.gradle (app) and build.gradle (project)? There is probably an error in any of these files.

  • I’ve been having the same problem for a few days. In fact, I saw many people with this error, and depending on the situation solve in different ways (clean and build the project, redefining the way and version of JDK, restarting Android Studio), but none of these worked for me. An option that I haven’t been able to test yet and I leave a hint is reinstall JDK, it’s one of the options that I saw that for some people solved, but I can’t test this at the moment. If you test this solution and it works, let me know so I can post the correct answer to your question.

  • Already tried to give a BUILD > REBUILD

  • You already updated your Android Studio Gradle?

  • @Wyllianneo this issue of reinstalling the JDK tbm have not tested, as soon as possible I will perform the tests and put the result.

  • @regmoraes posted the code of my files Gradle.

  • Can anyone help me as to the reason for this mistake? I have tried suggestions from the people who sent here, but it came to nothing.

  • The error was caused by this line: Compile 'mysql:mysql-Connector-java:5.1.37' I removed it and the project of my app worked, but isn’t it necessary for the app to connect to my database? Someone would know to tell me why she was eavesdropping?

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.