gpt4 book ai didi

java - Gradle构建错误:任务 ':app:prepareDebugDependencies'的执行失败

转载 作者:行者123 更新时间:2023-12-03 06:02:20 27 4
gpt4 key购买 nike

请帮助我解决此错误:

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.



这是我的 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')
}

和控制台输出:

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.

  • 尝试:
    使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。

    建立失败

    总时间:3.097秒

最佳答案

更改

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


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

关于java - Gradle构建错误:任务 ':app:prepareDebugDependencies'的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40941165/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com