Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio: Gradle build finished with error

I have been using Android Studio and I am getting this error when trying to build.I can't able to proceed.

This is the error in Android Studio:

    Executing tasks: [:libraries:facebook:generateDebugSources, :library:generateDebugSources, :volley:generateDebugSources]

    Configuration on demand is an incubating feature.
    WARNING [Project: :volley] "testPackageName" is deprecated (and will soon stop working); change to "testApplicationId" instead
    :libraries:facebook:preBuild
    :libraries:facebook:preDebugBuild
    :libraries:facebook:checkDebugManifest
    :libraries:facebook:prepareDebugDependencies
    :libraries:facebook:compileDebugAidl UP-TO-DATE
    :libraries:facebook:compileDebugRenderscript UP-TO-DATE
    :libraries:facebook:generateDebugBuildConfig UP-TO-DATE
    :libraries:facebook:generateDebugAssets UP-TO-DATE
    :libraries:facebook:mergeDebugAssets UP-TO-DATE
    :libraries:facebook:generateDebugResValues UP-TO-DATE
    :libraries:facebook:generateDebugResources UP-TO-DATE
    :libraries:facebook:packageDebugResources UP-TO-DATE
    :libraries:facebook:processDebugManifest UP-TO-DATE
    :libraries:facebook:processDebugResources UP-TO-DATE
    :libraries:facebook:generateDebugSources UP-TO-DATE
    :library:preBuild
    :library:preDebugBuild
    :library:checkDebugManifest
    :library:prepareDebugDependencies
    :library:compileDebugAidl UP-TO-DATE
    :library:compileDebugRenderscript UP-TO-DATE
    :library:generateDebugBuildConfig UP-TO-DATE
    :library:generateDebugAssets UP-TO-DATE
    :library:mergeDebugAssets UP-TO-DATE
    :library:generateDebugResValues UP-TO-DATE
    :library:generateDebugResources UP-TO-DATE
    :library:packageDebugResources UP-TO-DATE
    :library:processDebugManifest UP-TO-DATE
    :library:processDebugResources UP-TO-DATE
    :library:generateDebugSources UP-TO-DATE
    :volley:preBuild
    :volley:preDebugBuild
    :volley:checkDebugManifest
    :volley:prepareDebugDependencies
    :volley:compileDebugAidl UP-TO-DATE
    :volley:compileDebugRenderscript UP-TO-DATE
    :volley:generateDebugBuildConfig UP-TO-DATE
    :volley:generateDebugAssets UP-TO-DATE
    :volley:mergeDebugAssets UP-TO-DATE
    :volley:generateDebugResValues UP-TO-DATE
    :volley:generateDebugResources UP-TO-DATE
    :volley:packageDebugResources UP-TO-DATE
    :volley:processDebugManifest UP-TO-DATE
    :volley:processDebugResources UP-TO-DATE
    :volley:generateDebugSources UP-TO-DATE

BUILD FAILED

Total time: 2 mins 7.494 secs

This is my app gradle :

build.gradle :

        apply plugin: 'android'

    android {
        compileSdkVersion 19
        buildToolsVersion '19.1.0'
        defaultConfig {
            minSdkVersion 11
            targetSdkVersion 19
            versionCode 1
            versionName '1.0'
        }
        signingConfigs {
            release {

            }
        }
        buildTypes {
            release {
                signingConfig signingConfigs.release
            }
        }
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/ASL2.0'
        }
        productFlavors {
        }
    }


    dependencies {
        compile 'com.android.support:support-v4:19.1.0'
        compile 'com.google.android.gms:play-services:5.0.77'
        compile 'com.android.support:appcompat-v7:+'
        compile 'com.makeramen:roundedimageview:1.2.4'
        compile 'com.nineoldandroids:library:2.4.0+'
        compile project(':libraries:facebook')
        compile project(':library')
        compile project(':stripe')
        compile project(':volley')
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile files('libs/activation.jar')
        compile files('libs/mail.jar')
        compile files('libs/iprint.jar')
    }
like image 331
sherin Avatar asked Jul 11 '14 05:07

sherin


2 Answers

This Question is old but it may be useful for new programmers of Android Studio , So this error in my case solved by cleaning project from Build Menu.

like image 164
user5574803 Avatar answered Sep 25 '22 13:09

user5574803


I'm not sure if you post all error's text, in my case in the end will be very useful information to fix this trouble. Maybe in your case trouble is the same.

So, in my case was trouble with dependecies. In my app module in build.grale I used other dependencies for support.v4

In your case: compile 'com.android.support:support-v4:19.1.0'

Facebook SDK used jar, so, support.v4 was added as jar.

To fix this, just remove jar, and add to your Facebook build.gradle file the same line to import support library as on your main app module.

Hope, this will help you.

like image 23
Volodymyr Yatsykiv Avatar answered Sep 24 '22 13:09

Volodymyr Yatsykiv