2016-09-22 331 views
0

我在启用Proguard的情况下构建版本应用程序时出现问题。建筑坚持执行任务:app:transformClassesAndResourcesWithProguardForRelease需要超过40分钟!:app:transformClassesAndResourcesWithProguardForRelease花费太长时间

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile('com.github.afollestad.material-dialogs:core:[email protected]') { 
     transitive = true 
    } 
    apt 'com.jakewharton:butterknife-compiler:8.0.1' 
    compile 'com.android.support:appcompat-v7:24.2.0' 
    compile 'com.android.support:design:24.2.0' 
    compile 'com.android.support:support-v4:24.2.0' 
    compile 'com.android.support:percent:24.2.0' 
    compile 'com.android.support:recyclerview-v7:24.2.0' 
    compile 'com.android.support:cardview-v7:24.2.0' 
    compile 'com.google.android.gms:play-services-appindexing:9.4.0' 
    compile 'com.google.android.gms:play-services-analytics:9.4.0' 
    compile 'com.instabug.library:instabug:2.6.1' 
    compile 'net.hockeyapp.android:HockeySDK:4.1.0' 
    compile 'com.squareup.retrofit:retrofit:2.0.0-beta2' 
    compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2' 
    compile 'com.squareup.okhttp:logging-interceptor:2.6.0' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    compile 'com.jakewharton:butterknife:8.0.1' 
    compile 'com.mobsandgeeks:android-saripaar:2.0.3' 
    compile 'uk.co.chrisjenx:calligraphy:2.1.0' 
    compile 'joda-time:joda-time:2.8.2' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'info.hoang8f:android-segmented:1.0.6' 
    compile 'com.pnikosis:materialish-progress:1.7' 
    compile 'hanks.xyz:smallbang-library:0.1.2' 
    compile 'com.jzxiang.pickerview:TimePickerDialog:1.0.1' 
} 

什么可能是这混乱的原因?

谢谢!

+2

Happenning由于Android工作室更新到v 2.2?如果时间超过2分钟,请关闭Android Studio,重新启动并重新构建。如果没有,则会出现下载依赖关系的问题。 –

+0

你说得对。我做到了,它建得非常快。谢谢! –

回答

0

那么你有很多库,despiste上面的评论解决了你的问题,有一些提示,以帮助与很多图书馆工作。

在你的APP->的build.gradle

defaultConfig { 
    .... 
    multiDexEnabled true // add this 
} 

productFlavors { 
    // Define separate dev and prod product flavors. 
    dev { 
     // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin 
     // to pre-dex each module and produce an APK that can be tested on 
     // Android Lollipop without time consuming dex merging processes. 
     minSdkVersion 21 
    } 
    prod { 
     // The actual minSdkVersion for the application. 
     minSdkVersion 17 
    } 
} 

希望它可以帮助