android - 为什么我的 gradle 需要这么长时间? > 13 分钟

标签 android android-studio gradle build

为什么 Gradle 在我的电脑上需要这么长时间?尤其是在做了一些小改动之后?有些东西必须被打破。有人有什么想法吗?我在 Ubuntu 15.04 上使用 Android Studio。 Android Studio 已全面更新。

enter image description here

如果相关的话,这是我的 gradle 文件。

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.google.gms:google-services:1.3.0-beta1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

和...

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.0'

    defaultConfig {
        applicationId "ca.deanresin.arecipebook"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.android.support:design:23.0.1'
}

最佳答案

我觉得这行很奇怪:

classpath 'com.google.gms:google-services:1.3.0-beta1'

如果您使用 Google Services SDK,它应该在应用程序的 gradle 中,而不是在项目的 gradle 中。而且您的应用程序中也已经有 v7.8.0 之一。

这条线是什么?有这个必要吗?

apply plugin: 'com.google.gms.google-services'

关于android - 为什么我的 gradle 需要这么长时间? > 13 分钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33050812/

相关文章:

java - 如何在Android延迟后调用方法

android - 更改简单ListView多选Android的文本颜色

android - 如何在android中将视频上传到youtube?

android-studio - Android Studio 超慢,在任何新窗口打开时滞后和崩溃 - Mac,需要帮助调试

android - 海量矢量素材导入Android Studio

Android - ImageLoader 不会从 URL 重新检索图像

android - 如何在 Android 中将外部 jar 文件包含到 aar 文件中

gradle - 在 gradle 中为 liquibase 更新任务设置自定义 .properties 文件

android - 让 Jenkins 构建同一项目的不同风格

java - 我的 Android Studio 模拟器一直显示错误消息