0

我在 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.
4

1 回答 1

1

尝试在脚本中更改您的 gradle 版本号。将类路径从

classpath 'com.android.tools.build:gradle:0.5.+'

类似于

classpath 'com.android.tools.build:gradle:0.6.+'

或不同的版本号,具体取决于您安装的内容

于 2013-11-05T07:01:21.613 回答