【发布时间】:2014-01-29 01:17:49
【问题描述】:
我正在尝试使用 gradle build 运行一个简单的“hello world”android 应用程序。如果我发出命令,它会构建得很好
sudo ./gradlew build --> 构建良好
但没有 sudo,
./gradlew build --> 显示以下错误
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':MyStudioApplication'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':MyStudioApplication:_DebugCompile'.
> Could not find any version that matches com.android.support:appcompat-v7:+.
Required by:
workspace:MyStudioApplication:unspecified
* 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: 12.621 secs
以下是我的 build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
}
请帮忙
【问题讨论】:
-
是你发布完整文件的“build.gradle”吗?我没有看到对 appcompat 库的依赖。
标签: android unix ubuntu gradle android-gradle-plugin