android stdio 导入类库出错

当导入外部类库出现以下错误
错误:Execution failed for task ‘:app:dexDebug’. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_21\bin\java.exe” finished with non-zero exit value 2.

这是因为导入了两次同样的库所导致的的,只需要把其中一个删除,重新编译即可运行。
有时候你在自己app/libs目录下导入了A.jar 包,但是导入类库时 ,该类库libs目录下也存在同样的A.jar包,
这样会出现上面的错误。
参考:http://stackoverflow.com/questions/29629093/issue-while-adding-external-libraries-in-android-studio

猜你喜欢

转载自blog.csdn.net/u014774589/article/details/50528198