1
我在我的资产数据库文件(300MB)folder.When我运行它给了我下面的错误堆空间大小?
Error:Execution failed for task ':app:packageDebug'.
> Java heap space
ect's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
<em>org.gradle.jvmargs=-Xmx1024m</em>
<a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Read Gradle's configuration guide</a><br><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html">Read about Java's heap size</a>
下面的代码是gradle.properties
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
我试过很多东西像_JAVA_OPTIONS环境变量,更改值studio.exe.vmoptions和gradle.properties但它给了我同样的错误。
请帮忙
为什么你有300MB的资产而不是使用扩展文件? https://developer.android.com/google/play/expansion-files.html –
其实我必须在这个文件上工作一两天,之后的大小将减少到50MB,所以我没有去扩展文件。你有什么建议? –
使用扩展文件。这个数据是最有可能不会改变,所以没有点腹胀主要APK –