简体   繁体   English

android studio中导入的Android项目给出异常

[英]Android Project imported in android studio giving exception

I imported an eclipse project in android studio. 我在android studio中导入了一个eclipse项目。 On running the app, its giving the below error. 在运行该应用程序时,出现以下错误。 As suggested in some links, I run the command 'gradlew.bat clear' and after that restarted my android studio, but it didn't worked. 正如某些链接中所建议的那样,我运行命令“ gradlew.bat clear”,然后重启了我的android studio,但这没有用。

Please help me out 请帮帮我

Error:Execution failed for task ':app:dexDebug'. 错误:任务':app:dexDebug'的执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_45\\bin\\java.exe'' finished with non-zero exit value 2 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\\ Program Files \\ Java \\ jdk1.7.0_45 \\ bin \\ java.exe'以非零退出值2

Look if you have duplicates in gradle settings like this: 查看是否在gradle设置中有重复项,如下所示:

compile 'com.google.android.gms:play-services:+'
compile files('libs/google-play-services.jar')

that could also cause this issue. 这也可能导致此问题。 Remove one of lines if you have this. 如果有,请删除其中一行。

将Java版本更改为1.7并删除与libs文件有关的内容有助于我摆脱上述异常。

I changed the target version in my build.gradle file from targetSdkVersion 22 to targetSdkVersion 23 as i was using compileSdkVersion 23. The error went away and the app ran successfully after syncing ad rebuilding. 当我使用compileSdkVersion 23时,我将build.gradle文件中的目标版本从targetSdkVersion 22更改为targetSdkVersion23。错误消失了,同步广告重建后应用程序成功运行。 hope this helps someone 希望这可以帮助某人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM