Très TRÈS lent Gradle construire sur Android Studio

voici ma config:

MBP 2015, 8go de RAM, SSD

Android Studio 2.2.3

En moyenne, la construction de la dure 7/8 minutes, parfois 10/12 minutes

J'ai essayé TOUT ce que j'ai pu trouver en ligne, mais aucune ne semble fonctionner:

--- personnalisé VM option:

-Xms1024m
-Xmx8192m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=440m
-XX:+UseCompressedOops
-XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=UTF-8

--- Compilateur /configurer à la demande

--- Compilateur /compiler les modules en parallèle

--- Gradle /travailler hors connexion

--- gradle.fichier de propriétés:

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx8192m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -noverify
org.gradle.parallel=true
org.gradle.configureondemand=true
android.enableBuildCache=true

Quelqu'un a une idée de ce qui se passe, car il est tout simplement ridicule

Mise à JOUR:

Depuis je suis passé à 16 go de RAM, il y a évidemment une certaine amélioration, j'étais sous l'impression qu'il serait moins d'une minute ou deux, mais Cela prend 3 à 4 minutes, ce qui n'est pas acceptable: voici une partie de la Gradle journal que j'ai trouvé trop long:

git log --pretty=format:'%h %s'
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preAlphaBuild UP-TO-DATE
:app:preBirdsBuild UP-TO-DATE
:app:preKfgBuild UP-TO-DATE
:app:prePenBuild UP-TO-DATE
:app:prePrelaunchBuild UP-TO-DATE
:app:prePtr1Build UP-TO-DATE
:app:prePtr3Build UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareCnPedantSweetalertLibrary13Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2511Library
:app:prepareComAndroidSupportAppcompatV72511Library
:app:prepareComAndroidSupportCardviewV72511Library
:app:prepareComAndroidSupportDesign2511Library
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportRecyclerviewV72511Library
:app:prepareComAndroidSupportSupportCompat2511Library
:app:prepareComAndroidSupportSupportCoreUi2511Library
:app:prepareComAndroidSupportSupportCoreUtils2511Library
:app:prepareComAndroidSupportSupportFragment2511Library
:app:prepareComAndroidSupportSupportMediaCompat2511Library
:app:prepareComAndroidSupportSupportV132511Library
:app:prepareComAndroidSupportSupportV42511Library
:app:prepareComAndroidSupportSupportVectorDrawable2511Library
:app:prepareComAndroidSupportTransition2511Library
:app:prepareComCrashlyticsSdkAndroidAnswers1310Library
:app:prepareComCrashlyticsSdkAndroidBeta122Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics265Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore2314Library
:app:prepareComDevbracketsAndroidExomedia311Library
:app:prepareComEftimoffAndroidViewpagerTransformers101Library
:app:prepareComGithubCastorflexSmoothprogressbarLibrary110Library
:app:prepareComGithubHotchemiPermissionsdispatcher230Library
:app:prepareComGithubKibotuAndroidAnimationsActions107Library
:app:prepareComGithubKibotuBloodHound105Library
:app:prepareComGithubKibotuCommonAndroidUtils072Library
:app:prepareComGithubKibotuGooglePlayForceUpdate108Library
:app:prepareComGithubKibotuNetKibotuAndroidDeviceinfo121Library
:app:prepareComGithubKibotuOpenAndroidSSLWrapper107Library
:app:prepareComGithubKibotuRecyclerViewPresenter141Library
:app:prepareComGithubKibotuShareIntentBuilderV003Library
:app:prepareComGithubKibotuTimeBomb110Library
:app:prepareComGithubKibotuUrlShortener107Library
:app:prepareComGithubOrhanobutHawk123Library
:app:prepareComGithubOzodrukhCircularReveal201Library
:app:prepareComGoogleAndroidExoplayerExoplayerR1513Library
:app:prepareComGoogleAndroidGmsPlayServicesAds1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics1001Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1001Library
:app:prepareComGoogleAndroidGmsPlayServicesBase1001Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement1001Library
:app:prepareComGoogleAndroidGmsPlayServicesClearcut1001Library
:app:prepareComGoogleAndroidGmsPlayServicesGass1001Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm1001Library
:app:prepareComGoogleAndroidGmsPlayServicesIid1001Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1001Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks1001Library
:app:prepareComGoogleFirebaseFirebaseAnalytics1001Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1001Library
:app:prepareComGoogleFirebaseFirebaseCommon1001Library
:app:prepareComGoogleFirebaseFirebaseCore1001Library
:app:prepareComGoogleFirebaseFirebaseIid1001Library
:app:prepareComGoogleFirebaseFirebaseMessaging1001Library
:app:prepareComJakewhartonButterknife840Library
:app:prepareComJakewhartonProcessPhoenix110Library
:app:prepareComMikepenzFastadapter210Library
:app:prepareComMikepenzIconicsCore280Library
:app:prepareComMikepenzMaterialdrawer581Library
:app:prepareComMikepenzMaterialize100Library
:app:prepareComMukeshMarkdownview100Library
:app:prepareComNightonkeJellytogglebutton102Library
:app:prepareComNightonkeWowoviewpager102Library
:app:prepareComOgaclejapanSmarttablayoutLibrary161Library
:app:prepareComOgaclejapanSmarttablayoutUtilsV4161Library
:app:prepareComPnikosisMaterialishProgress10Library
:app:prepareComSbrukhandaFragmentviewpagerFragmentviewpager100Library
:app:prepareComShawnlinNumberPicker101Library
:app:prepareComSloydevPreferator100Library
:app:prepareComYydcdutRxmarkdown005Library
:app:prepareComZplesacConnectionbuddy140Library
:app:prepareHanksXyzHtextviewLibrary015Library
:app:prepareIoFabricSdkAndroidFabric1314Library
:app:prepareIoNlopezSmartlocationLibrary329Library
:app:prepareIoReactivexRxandroid121Library
:app:prepareJpWasabeefGlideTransformations201Library
:app:prepareJpWasabeefRecyclerviewAnimators225Library
:app:prepareMeGrantlandAutofittextview021Library
:app:prepareMeRelexCircleindicator122Library
:app:prepareNetDanlewAndroidJoda297Library
:app:prepareUkCoChrisjenxCalligraphy220Library
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: ../google-services.json
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:javaPreCompileDebug
:app:compileDebugKotlin

jusqu'ici est très bien, mais la :app:compileDebugKotlin prend environ 60 secondes ...

et puis,

...
...
:app:copyDebugKotlinClasses
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources
:app:transformClassesWithRetrolambdaForDebug
:app:transformClassesWithDexForDebug

Cette dernière ligne reste tant que bien.

Ce sera largement varier selon le projet que vous êtes en train de construire. Pouvez-vous nous donner plus d'informations sur ce qu'est le projet? Voyez-vous ce qui arrive à chaque projet?
Pouvez-vous partager la sortie de la gradle fenêtre de message? Dans la plupart des cas - extremey long temps de construire sont dues à gradle téléchargement externe libs au lieu d'utiliser les copies mises en cache. Nous aimerions savoir à coup sûr dans les journaux.
Si vous avez le Jack compilateur activé que pourrait être une cause. J'ai trouvé qu'il a grandement augmenté mon temps de construire.
Jack n'est pas activé 🙁
le projet n'est pas petit, mais pas trop, je suis en utilisant Java et Kotlin, mais le plus triste c'est que même si je n'ai pas toucher au code, et juste relancer l'application, il prend une éternité pour construire

OriginalL'auteur El Jazouli | 2017-07-26