gpt4 book ai didi

java - 无法在 Android Studio 2.1.1 的 gradle.properties 文件中设置 JVM 参数 gradle

转载 作者:搜寻专家 更新时间:2023-10-30 21:10:34 24 4
gpt4 key购买 nike

-在 Mac OS X 上运行 Android 2.1.1

-应用程序不在 Android 手机上。

gradle.properties 文件的内容

org.gradle.jvmargs=-Xmx2048M

enter image description here

悬停时,IDE 指示它是一个未使用的属性。它也应该是深蓝色而不是灰色。

输出:

:MyProjectDirName:transformClassesWithInstantRunSlicerForDebug
:MyProjectDirName:transformClassesWithDexForDebug
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon
to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project
gradle.properties.
For more information see
https://docs.gradle.org/current/userguide/build_environment.html

编译器的输出清楚地表明它丢弃了 gradle.properties 文件的内容。

contents build.gradle

android {
dexOptions {
javaMaxHeapSize "2g"
}
}

也尝试过这些设置,但没有成功:

enter image description here

最佳答案

尝试在 gradle.properties 文件中添加 'org.gradle.daemon=true'

/Users/<username>/.gradle/ (Mac)

C:\Users\<username>\.gradle (Windows)

答案来自

https://stackoverflow.com/a/33184794/1915831

https://stackoverflow.com/a/19500539/1915831

关于java - 无法在 Android Studio 2.1.1 的 gradle.properties 文件中设置 JVM 参数 gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37531536/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com