user2003857
user2003857

Reputation: 45

Gradle Build Error: Execution failed for task ':app:prepareDebugDependencies'

Please help me to fix this error:

Warning:Project app: apk-only dependencies can only be jars. com.google.android.gms:play-services:aar:6.5.87 is an Android Library.

Error:Execution failed for task ':app:prepareDebugDependencies'. Dependency Error. See console for details.

This is my Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.palletdesig.colopovideo"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    apk 'com.google.android.gms:play-services:6.5.87'
    compile files('libs/Parse-1.3.0.jar')
}

And the console output:

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

Configuration on demand is an incubating feature.
WARNING: Project app: apk-only dependencies can only be jars. com.google.android.gms:play-services:aar:6.5.87 is an Android Library.
WARNING: Project app: apk-only dependencies can only be jars. com.google.android.gms:play-services:aar:6.5.87 is an Android Library.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72103Library
:app:prepareComAndroidSupportSupportV42103Library
:app:prepareComGoogleAndroidGmsPlayServices6587Library UP-TO-DATE
:app:prepareDebugDependencies
Project app: apk-only dependencies can only be jars. com.google.android.gms:play-services:aar:6.5.87 is an Android Library.

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:prepareDebugDependencies'.

    Dependency Error. See console for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 3.097 secs

Upvotes: 0

Views: 2186

Answers (1)

Dinesh
Dinesh

Reputation: 219

Change

apk 'com.google.android.gms:play-services:6.5.87'

to

compile 'com.google.android.gms:play-services:6.5.87'

Upvotes: 0

Related Questions