2016-09-22 238 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 
    } 
} 

希望它可以幫助