当前位置: 首页 > 知识库问答 >
问题:

Android Studio 3.1卡在配置构建超过30分钟

扶隐水
2023-03-14

所以我刚刚把我的Android Studio从3.0.1更新到了3.1。当我输入这个的时候,超过30分钟已经过去了,Android Studio被困在配置构建中。

我做了什么:

  1. 更改项目渐变文件中的渐变版本


我的项目build.gradle

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

buildscript {

    repositories {
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


这是我的申请build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.smk.carsapp"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
configurations {
    all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:exifinterface:27.1.0'
    implementation 'com.android.support:support-v13:27.1.0'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.wdullaer:materialdatetimepicker:3.5.1'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    implementation 'com.jsibbold:zoomage:1.1.0'
    implementation 'com.siclo.ezphotopick:library:1.0.8'
    //    TEST
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
}
repositories {
    mavenCentral()
    maven {
        url 'https://dl.bintray.com/siclo/SicloAndroidOSS'
    }
}

共有3个答案

唐阳飙
2023-03-14

单击打开屏幕截图

启用切换脱机模式解决了我的问题。查看屏幕截图了解更多详细信息。

如果没有选择,就选择这个。它以前对我有用它需要25-30分钟现在只需要几秒钟

云欣嘉
2023-03-14

修复:我更改了gradle包装中的distributionUrl。属性,如Santanu在这里所指出的。

在渐变包装中。属性使用以下选项:-

distributionUrl=https\://服务。格拉德尔。org/distributions/gradle-4.4-all。邮政编码

而不是4.1-all。拉链

益富
2023-03-14

试试这个:

Android Studio转到文件-

检查“全局渐变设置”下的“脱机工作”

它将减少80%的渐变构建时间。

检查Gradle依赖关系

buildscript {
  dependencies {
     classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
 }
 }

添加dexOption并给出以下heapsize

dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
 类似资料:
  • 我已经根据日期yyyy-mm-dd对配置单元表进行了分区。我想每天运行一个脚本,可以删除所有超过30天的分区,但在这种情况下,我不想超过日期。我希望它采取系统日期和删除超过30天的分区。

  • 从本篇文档开始,我们将介绍 Lavas 构建、运行中使用的配置项。开发者可以在项目根目录下的 lavas.config.js 中定义这些配置项。配置对象的结构大致如下: // lavas.config.js { build: {}, router: {}, middleware: {}, // 省略其他配置项 } Lavas 内部使用 Webpack 进行构建,

  • 我们假设你已经知道,如何为纯客户端 (client-only) 项目配置 webpack。服务器端渲染 (SSR) 项目的配置大体上与纯客户端项目类似,但是我们建议将配置分为三个文件:base, client 和 server。基本配置 (base config) 包含在两个环境共享的配置,例如,输出路径 (output path),别名 (alias) 和 loader。服务器配置 (serve

  • 我们假设你已经知道,如何为纯客户端(client-only)项目配置 webpack。服务器端渲染(SSR)项目的配置大体上与纯客户端项目类似,但是我们建议将配置分为三个文件:base,client和server。基本配置(base config)包含在两个环境共享的配置,例如,输出路径(output path),别名(alias)和 loader。服务器配置(server config)和客户端

  • Nuxt.js 允许你根据服务端需求,自定义 webpack 的构建配置。 analyze Nuxt.js 使用 webpack-bundle-analyzer 分析并可视化构建后的打包文件,你可以基于分析结果来决定如何优化它。 类型: Boolean 或 Object 默认值: false 如果是 Object 类型, 可以移步 这里 查看可用的属性。 例如 (nuxt.config.js):