0

我的项目之前构建良好,但现在升级到 Android Studio 2.1.2 时出现错误:

在此处输入图像描述

这是我的build.gradle文件中的内容:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'android'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        applicationId "com.puc.mobile"
        minSdkVersion 14
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    //compile files('libs/crashlytics.jar')
    compile files('libs/FLurry_3.2.2.jar')
    compile files('libs/universal-image-loader-1.9.2.jar')
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    // You must install or update the Google Repository through the SDK manager to use this dependency.
    compile files('libs/commons-lang3-3.4.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
        transitive = true;
    }
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile files('libs/Parse-1.13.0.jar')
    compile 'com.android.support:support-v4:19.0.0'
    compile 'com.google.android.gms:play-services:9.2.0'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.google.android.gms:play-services-ads:9.2.0'
    compile 'com.google.android.gms:play-services-auth:9.2.0'
    compile 'com.google.android.gms:play-services-gcm:9.2.0'
}

我意识到构建工具版本存在一些问题,但老实说,我不确定如何解决它。有什么线索吗?

更新:

buildToolsVersion如下所述更新后,我收到错误:

在此处输入图像描述

4

1 回答 1

0

发生这种情况是因为 Build Tools 版本 19.1.0 不存在。

最新版本是23.0.3.

这些工具包含在 SDK 包中并安装在<sdk>/build-tools/目录中。

改变你的build.gradle

android {
   buildToolsVersion "23.0.3"
   // ...

}

SDK 构建工具发行说明

于 2016-07-07T22:35:11.070 回答