Android工作室Gradle同步并生成错误 [英] Android studio Gradle sync and build error

查看:150
本文介绍了Android工作室Gradle同步并生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是android studio和gradle的新手,我的AS 0.5。我下载了0.8.1更新包并通过删除已安装的文件并将更新文件复制到程序文件文件夹进行了更新。它运行正确,但是当我尝试同步gradle时,出现此错误。这真的令人沮丧,因为我有一个非常缓慢的互联网连接,我已经尝试删除.gradle文件,并再次尝试没有运气。任何帮助将不胜感激。我的ADT目前因为r23的bug而搞砸了。我认为AS会提供出路,现在我再次陷入困境。

 错误:无法启动守护进程。 
这个问题可能是由于守护进程配置不正确引起的。
例如,使用无法识别的jvm选项。
请参阅http://gradle.org/docs/1.12/userguide/gradle_daemon.html

守护进程的用户指南一章。请阅读以下流程输出以了解更多信息:

18:44:13.593 [main] DEBUG ogldaemon.bootstrap.DaemonMain - 假设守护进程是从以下jvm选择开始的:[-XX:MaxPermSize = 256m,-XX:+ HeapDumpOnOutOfMemoryError,-Xmx1024m ,-Dfile.encoding = windows-1252]

失败:生成失败,出现异常。

*出错:
无法使用DaemonServices.createDaemonContext()创建DaemonContext类型的服务。

*尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。


解决方案

以管理员身份运行Android Studio。它为我解决了这个问题。

I am new to android studio and gradle and i got AS 0.5. I downloaded the 0.8.1 update package and updated by deleting the installed files and copying the update files to the program files folder. It runs correctly but when i try to sync gradle, i get this error. It's really frustrating because i have an extremely slow internet connection and i have tried deleting the .gradle file and trying again wit no luck. Any help will be appreciated. My ADT is currently messed up because of the r23 bug. I thought AS will offer a way out and now I'm stuck again.

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html

Please read below process output to find out more:

18:44:13.593 [main] DEBUG o.g.l.daemon.bootstrap.DaemonMain - Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type DaemonContext using DaemonServices.createDaemonContext().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option  to get more log output.

解决方案

Run Android Studio as administrator. It fixed the problem for me.

这篇关于Android工作室Gradle同步并生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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