我正嘗試使用gradle構建運行簡單的「hello world」android應用。如果我發出命令無法使用Gradle構建Android應用,除了使用sudo
須藤./gradlew建立它建立精細 - >建立精細
但沒有sudo,
./gradlew構建 - >顯示以下錯誤
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 lib的依賴。 – owe