gpt4 book ai didi

android - 使用 Gradle 控制台命令 (gradlew) 的问题

转载 作者:行者123 更新时间:2023-12-03 05:15:27 26 4
gpt4 key购买 nike

我正在控制台中使用 gradlew 命令编译一个项目,但出现此错误:

BUILD FAILED

Total time: 16.775 secs
Err:
Err:FAILURE: Build failed with an exception.
Err:
Err:* What went wrong:
Err:A problem occurred configuring project ':capLibrary'.
Err:> Could not resolve all dependencies for configuration ':capLibrary:_debugCompile'.
Err: > Could not find com.android.support:support-v4:22.2.1.
Err: Searched in the following locations:
Err: https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
Err: https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
Err: Required by:
Err: CapAndroid:capLibrary:unspecified
Err: > Could not find com.google.android.gms:play-services:7.5.0.
Err: Searched in the following locations:
Err: https://jcenter.bintray.com/com/google/android/gms/play-services/7.5.0/play-services-7.5.0.pom
Err: https://jcenter.bintray.com/com/google/android/gms/play-services/7.5.0/play-services-7.5.0.jar
Err: Required by:
Err: CapAndroid:capLibrary:unspecified

我不知道出了什么问题,这些是我的 gradle 依赖项:

对于应用程序模块:
dependencies {
compile project(':capLibrary')
compile 'com.google.android.gms:play-services:7.5.0'
}

对于库模块( capLibrary ):
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
}

这是库的完整 gradle.build 文件 ( capLibrary):
apply plugin: 'com.android.library'

android {
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion "22.0.1"

defaultConfig {
minSdkVersion 10
targetSdkVersion 10
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}

dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
}

这是应用程序模块的完整 gradle.build:
apply plugin: 'com.android.application'

android {
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.example.launcher"
minSdkVersion 10
targetSdkVersion 10
}

signingConfigs {
release {
storeFile file("dummy")
storePassword "dummy"
keyAlias "dummy"
keyPassword "dummy"
}
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}

dependencies {
compile project(':capLibrary')
compile 'com.google.android.gms:play-services:7.5.0'
}

最佳答案

运行 Android SDK 管理器。

tip: in console write >> android [enter]



并从 Android SDK Manager/Extras 安装:
  • Android 支持库
  • 谷歌仓库
  • 关于android - 使用 Gradle 控制台命令 (gradlew) 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32135296/

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