0
我更新在的gradle Ubuntu的13無法在由於搖籃真實設備運行Android應用被過時
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle
的build.gradle在MyApplicationProject/MyApplication的:
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
}
}
I」試圖在連接到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.
嘗試了不同的版本號,並沒有幫助。 –
在項目的根目錄中運行命令./gradlew -v它將打印您正在使用的gradle版本。檢查該版本。如果是新的,請嘗試./gradlew --refresh –
它是1.6。但刷新說'沒有參數提供了命令行選項'--refresh'' –