【问题标题】:Android Studio Build stuck when minifyEnabled is true当 minifyEnabled 为 true 时,Android Studio Build 卡住
【发布时间】:2019-02-03 12:26:49
【问题描述】:

Android Studio Generate Signed Apk 卡在

app:transformClassesAndResourcesWithProguardRelease
ExcecuteTransform

当 minifyEnabled 为 false 时有效

我的 app.gradle 文件

apply plugin: 'com.android.application'


android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.ashishclasses"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 3
        versionName "1.0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            shrinkResources false
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.google.firebase:firebase-firestore:18.0.0'
    implementation 'com.android.support:design:28.0.0'

    implementation 'com.android.support:customtabs:28.0.0'
//    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation "com.vimeo.networking:vimeo-networking:1.1.3"
//    implementation 'com.mcxiaoke.volley:library:1.0.18'
//    implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:9.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
//    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.google.firebase:firebase-ads:17.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

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

我什至删除了我所有的 proguard 规则,现在 proguard-rules.pro 只是一个空文件

请告诉我如何在启用 proguard 的情况下构建 apk

【问题讨论】:

    标签: android-studio android-gradle-plugin


    【解决方案1】:

    我一直在运行我的构建,并在 20 分钟后终于

    Gradle build finished in 20 m 45 s 428 ms
    

    我的问题已经解决了,但实际上并没有解决。

    我的签名 apk 的简单构建需要 1-2 分钟,启用 minify 需要 20 多分钟

    而且我的硬件还不错,

    我有 6gb ram 和 ssd,在 arch linux 和 AMD A8 处理器上使用

    【讨论】:

      猜你喜欢
      • 2019-12-08
      • 1970-01-01
      • 2016-03-16
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 2021-12-17
      • 2018-11-13
      相关资源
      最近更新 更多