Android Studio 2.3中出现com.android.dx.command.Main错误 [英] Error com.android.dx.command.Main in Android Studio 2.3

查看:176
本文介绍了Android Studio 2.3中出现com.android.dx.command.Main错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建项目时出现错误.任何人以前都有此错误.我已更新至Android Studion2.3并正常构建,但现在不知道为什么会出现此错误.清理,重建,但仍然存在此错误.

I have error when building project. Anybody have this error before. I updated to Android Studion2.3 and build normally, but now I don't know why having this error. Clean, Rebuild but still have this error.

我的礼物

 compileSdkVersion 25
    buildToolsVersion '25'

错误:任务执行失败 ':app:transformClassesWithDexForDebug'.

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException:java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:执行时出错 主类为com.android.dx.command.Main的Java进程 参数{--dex --force-jumbo --num-threads = 4 --multi-dex --output D:\ GIT TECHUB \ pocca_android.git \ app \ build \ intermediates \ transforms \ dex \ debug \ folders \ 1000 \ 5 \ slice_2 D:\ GIT TECHUB \ pocca_android.git \ app \ build \ intermediates \ transforms \ instantRunSlicer \ debug \ folders \ 1 \ 5 \ slice_2}

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --force-jumbo --num-threads=4 --multi-dex --output D:\GIT TECHUB\pocca_android.git\app\build\intermediates\transforms\dex\debug\folders\1000\5\slice_2 D:\GIT TECHUB\pocca_android.git\app\build\intermediates\transforms\instantRunSlicer\debug\folders\1\5\slice_2}

推荐答案

我找到了原因,在我的应用中创建了文件错误日志-内存不足.我重新启动计算机,现在可以工作了.但是我的计算机16Gb ram,Android Studio仅使用了将近2Gb ram,但是错误仍然会发生

I found the reason, a file error log created in my app -- insufficient memory. I restart my computer and now I worked. But my computer 16Gb ram, Android Studio only use nearly 2Gb ram, but error still happen

hs_err_pid4936.log

没有足够的内存来使Java Runtime Environment继续运行. 本机内存分配(malloc)无法为Chunk :: new分配604656字节 可能的原因: 系统没有物理RAM或交换空间 在32位模式下,达到了进程大小限制 可能的解决方案: 减少系统上的内存负载 增加物理内存或交换空间 检查交换后备存储是否已满 在64位操作系统上使用64位Java 减少Java堆大小(-Xmx/-Xms) 减少Java线程数 减少Java线程堆栈大小(-Xss) 使用-XX:ReservedCodeCacheSize =设置更大的代码缓存 此输出文件可能被截断或不完整.

There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (malloc) failed to allocate 604656 bytes for Chunk::new Possible reasons: The system is out of physical RAM or swap space In 32 bit mode, the process size limit was hit Possible solutions: Reduce memory load on the system Increase physical memory or swap space Check if swap backing store is full Use 64 bit Java on a 64 bit OS Decrease Java heap size (-Xmx/-Xms) Decrease number of Java threads Decrease Java thread stack sizes (-Xss) Set larger code cache with -XX:ReservedCodeCacheSize= This output file may be truncated or incomplete.

内存不足错误(allocation.cpp:390),pid = 4936,tid = 0x000000000000156c

Out of Memory Error (allocation.cpp:390), pid=4936, tid=0x000000000000156c

JRE版本:Java(TM)SE运行时环境(8.0_101-b13)(内部版本1.8.0_101-b13) Java虚拟机:Java HotSpot(TM)64位服务器虚拟机(25.101-b13混合模式Windows-amd64压缩的oops) 无法写入核心转储.默认情况下,在Windows客户端版本上不启用小型转储

JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode windows-amd64 compressed oops) Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

这篇关于Android Studio 2.3中出现com.android.dx.command.Main错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆