簡體   English   中英

運行在Android Gradle構建中運行Proguard的堆

[英]Running out of heap running Proguard in Android Gradle build

當我嘗試在我的Gradle構建中在本地機器上運行Proguard時,出現“Java堆空間”錯誤。 特別:

:<app_name>:proguardRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':<app_name>:proguardRelease'.
> Java heap space

我嘗試設置我的GRADLE_OPTS = -Xmx2048m,但我仍然收到堆空間錯誤。

有什么建議?

這是我的日志輸出的結束:

:Tinder:proguardRelease
ProGuard, version 4.9
Reading input...
Reading program directory [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/classes/release]
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/library.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/androidannotations-api-2.7.1.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/picasso-1.1.1.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/gcm.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/ViewPagerIndicator.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/nineoldandroids.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/crittercism_v3_0_11_sdkonly.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/google-play-services.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/facebook.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/PullToRefresh.aar/classes.jar] (filtered)
Reading program jar [/Applications/android-studio.app/sdk/extras/android/m2repository/com/android/support/support-v4/13.0.0/support-v4-13.0.0.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/apphance-library.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/simple-crop-image-lib.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/windowed-seek-bar.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/com.kontagent.android.sdk.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/ActionBarSherlock.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/google-play-services_lib.aar/classes.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/libs/gson-2.2.4.jar] (filtered)
Reading program jar [/Users/jabdulius/Documents/Dropbox/workspace-tinder/Tinder/build/exploded-bundles/volley.aar/classes.jar] (filtered)
Reading library jar [/Applications/android-studio.app/sdk/platforms/android-17/android.jar]
:Tinder:proguardRelease FAILED

您是否也導出了環境變量(在Linux和BSD上)?

export GRADLE_OPTS=-Xmx2048m

如果有人在AndroidStudio中遇到此問題,沒有Gradle,解決方案是為proguard添加一些內存:

Android Studio >> Preferences >> Compilers >> 
Android Compiler >> Proguard Options = -Xmx2048m

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM