-1

After creating a new project when I try to run the app it shows build failed error.

I searched for it on the internet, they say that it may be due to duplicate libraries of gradle or duplicate dependencies in gradle file, but it wasn't so In my case.

Here is my build.gradle file :

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        applicationId "com.example.naveenjain.ayusch"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }   
 } 
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Ayusch
  • 417
  • 7
  • 17
  • 1
    Have a look at this: http://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle – morpheus05 Jan 01 '16 at 17:31
  • But in latest version of android studio there is no folder named libraries – Ayusch Jan 01 '16 at 18:24
  • Nothing worked please help!! – Ayusch Jan 02 '16 at 03:42
  • There is a problem with your project, that is why you get this error. Other then trying various gradle build jobs ("build", "assemble") to get a better a error message its very difficult to help. (It could be the 65K method limit, another problem there is a lot of stuff which could go wrong) – morpheus05 Jan 02 '16 at 10:35
  • You problem has absolutely nothing to do with Gradle. Read the error message. `You need to use Theme.AppCompat (or descendant) with the design library.` That has been answered very heavily [here](http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity). – OneCricketeer Apr 05 '16 at 21:31

1 Answers1

-1

Try to delete this line:

compile fileTree(dir: 'libs', include: ['*.jar'])

Or you could set multiDexEnabled true:

defaultConfig {        
    // Enabling multidex support.
    multiDexEnabled true
}

and try again. Hope it helps.

Maverick.pe
  • 1,917
  • 4
  • 15
  • 20
  • Sorry, I think I posted the wrong error image by mistake. I have been searching the internet for a fix on this error whole day but no solution worked. Please see the updated screenshot. – Ayusch Jan 04 '16 at 20:10