Android 格雷德尔·唐';t构建于:应用程序:合并调试资源失败

Android 格雷德尔·唐';t构建于:应用程序:合并调试资源失败,android,gradle,build,heap,heap-memory,Android,Gradle,Build,Heap,Heap Memory,我最近启动了一个新的Android应用程序,我遇到了一个非常恼人的错误,它让我无法构建这个项目 Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDe

我最近启动了一个新的Android应用程序,我遇到了一个非常恼人的错误,它让我无法构建这个项目

Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources]
Observed package id 'add-ons;addon-google_apis-google-23' in inconsistent location 'C:\Users\Fabio\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23-1' (Expected 'C:\Users\Fabio\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23')
Already observed package id 'add-ons;addon-google_apis-google-23' in 'C:\Users\Fabio\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23'. Skipping duplicate at 'C:\Users\Fabio\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23-1'
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library
:app:prepareComAndroidSupportAppcompatV72400Library
:app:prepareComAndroidSupportDesign2400Library
:app:prepareComAndroidSupportRecyclerviewV72400Library
:app:prepareComAndroidSupportSupportV42400Library
:app:prepareComAndroidSupportSupportVectorDrawable2400Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
java.lang.OutOfMemoryError: Java heap space
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
> java.lang.OutOfMemoryError: Java heap space
radle.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>
Information:BUILD FAILED
Information:Total time: 9.513 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
我刚刚启动了这个应用程序。它只有两个活动和4个显示器。几乎没有资源,尽管有一些字符串和图像。为什么我会面临堆内存的问题?可能是因为我同时打开了两个android studio项目吗

我正在使用: -渐变版本2.10 -Android插件版本2.1.2

我已经运行了“清理项目”、“重建项目”、“与gradle文件同步项目”。这没用


提前感谢您的帮助

我认为这是您的资源问题。 查看您在可绘制中使用的图像大小。
减小图像的大小和分辨率,然后重建项目。

可能的话。或者你的项目真的很大。增加配置文件中的堆大小,在这种情况下,向堆中抛出内存是正确的解决方案。我认为这个项目没有那么大。我刚开始,它只有两个活动。我不认为它可能是项目的大小…同意,这听起来不像,除非你刚开始有一个很小的java堆。伙计,你是最好的!这就是原因。我得到了一个转换成xml的svg文件,我没有意识到它有20000dp的宽度和巨大的高度。我把它调整到了正常大小,现在它可以正常构建了!谢谢
:app:mergeDebugResources
java.lang.OutOfMemoryError: Java heap space
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
> java.lang.OutOfMemoryError: Java heap space