要在使用dexer处理OOM错误:
,使用的是DX脚本会在构建并将其设置为dexer默认堆大小。该脚本住在这里:
$ ANDROID_SDK /编译工具/ DX(或dx.bat取决于OS)。
有一个部分在那里,看起来像这样:
# By default, give dx a max heap size of 1 gig. This can be overridden
# by using a "-J" option (see below).
defaultMx="-Xmx1024M"
# The following will extract any initial parameters of the form
# "-J" from the command line and pass them to the Java
# invocation (instead of to dx). This makes it possible for you to add
# a command-line parameter such as "-JXmx256M" in your scripts, for
# example. "java" (with no args) and "java -X" give a summary of
# available options.
javaOpts=""
也许尝试改变javaOpts到-Xmx2048M或类似的东西。