我在 Ubuntu 13 更新了 gradle
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle
MyApplicationProject/MyApplication 中的build.gradle :
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 16
}
}
我正在尝试在连接到 USB 的手机上运行一个项目。但它说:
Uploading file
local path: /home/alex/AndroidStudioProjects/MyApplicationProject/MyApplication/build/classes/debug/MyApplication.apk
remote path: /data/local/tmp/com2.example.myapplication
Local path doesn't exist.
Unexpected Error
Local path doesn't exist.
Local path doesn't exist.
The project may need to be synced with Gradle files.
我这样做Tool-> Android -> Sync Project with Gradle Files
并得到一个错误:
它说:
Failed to refresh Gradle project 'MyApplicationProject': You are using an old, unsupported version of Gradle. Please use version 1.8 or greater. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.