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 –