[size=medium][b]1. 错误:[/b][/size]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5237/bd6dc9f3-4062-3bde-98d7-e8632255f44e.png[/img][/align]
[size=medium]Android Studio中编译运行loginweb项目的时候,报出了上述错误:[/size]
[size=medium]Error:Execution failed for task ':loginweb:dexDebug'.[/size]
[size=medium]> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'M:\java\jdk7u45\bin\java.exe'' [color=red]finished with non-zero exit value 2[/color][/size]
[size=medium][b]2. 原因:[/b][/size]
[size=medium]项目中出现了重复加载的jar包。[/size]
[size=medium][b](1)[/b]libs目录下存放有jar包,但是build.gradle中也写了导包语句。[/size]
[size=medium][b](2)[/b]新引入的Library项目中引用了主项目中已经引用的jar包,导致重复加载包。[/size]
[size=medium][b]3. 解决思路:[/b][/size]
[size=medium](1)先检查Android 兼容包 support-v4 和 support-v7 包;[/size]
[size=medium](2)再检查一些常用的开源项目,比如:Gson、Butter Knife、EventBus、Nineoldandroids等。[/size]
[size=medium](3)建议:不要将jar包放到libs目录下,而要用Gradle构建,即在build.gradle中写导包语句。[/size]
[size=medium][b]4. 我的报错原因及解决[/b][/size]
[size=medium]我的项目报错,属于第(1)个原因,即在libs目录下和build.gradle中都导了Butter Knife的包。[/size]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5239/525bb400-9dcb-3c70-ab4e-b5fc9f6e8c4f.png[/img][/align]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5241/461e1185-308a-396b-9459-8190b2d004a8.png[/img][/align]
[size=medium]因此,把libs目录下的jar包删除,再运行,就成功了。[/size]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5237/bd6dc9f3-4062-3bde-98d7-e8632255f44e.png[/img][/align]
[size=medium]Android Studio中编译运行loginweb项目的时候,报出了上述错误:[/size]
[size=medium]Error:Execution failed for task ':loginweb:dexDebug'.[/size]
[size=medium]> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'M:\java\jdk7u45\bin\java.exe'' [color=red]finished with non-zero exit value 2[/color][/size]
[size=medium][b]2. 原因:[/b][/size]
[size=medium]项目中出现了重复加载的jar包。[/size]
[size=medium][b](1)[/b]libs目录下存放有jar包,但是build.gradle中也写了导包语句。[/size]
[size=medium][b](2)[/b]新引入的Library项目中引用了主项目中已经引用的jar包,导致重复加载包。[/size]
[size=medium][b]3. 解决思路:[/b][/size]
[size=medium](1)先检查Android 兼容包 support-v4 和 support-v7 包;[/size]
[size=medium](2)再检查一些常用的开源项目,比如:Gson、Butter Knife、EventBus、Nineoldandroids等。[/size]
[size=medium](3)建议:不要将jar包放到libs目录下,而要用Gradle构建,即在build.gradle中写导包语句。[/size]
[size=medium][b]4. 我的报错原因及解决[/b][/size]
[size=medium]我的项目报错,属于第(1)个原因,即在libs目录下和build.gradle中都导了Butter Knife的包。[/size]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5239/525bb400-9dcb-3c70-ab4e-b5fc9f6e8c4f.png[/img][/align]
[align=center][img]http://dl2.iteye.com/upload/attachment/0111/5241/461e1185-308a-396b-9459-8190b2d004a8.png[/img][/align]
[size=medium]因此,把libs目录下的jar包删除,再运行,就成功了。[/size]