Android Studio 一直说无法完成 Gradle 执行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23598480/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio Keep saying Failed to complete Gradle execution
提问by Hiep
Everything fine with the command line
命令行一切正常
gradle build
But Android Studio keep saying that
但是 Android Studio 一直在说
Failed to complete Gradle execution
Cause:
A fatal exeption has occurred. Program will exit
If I clear all the cache, and restart everything will be fine, but this dialog will easily comeback again (after a build fail). I guess that the increment build chain is not good, but the message is not helpful at all.
如果我清除所有缓存,然后重新启动一切都会好起来的,但是这个对话框很容易再次出现(在构建失败后)。我猜增量构建链不好,但消息根本没有帮助。
Are there anythings I can do to get a more details message about what going on, why AndroidStudio Gradle failed? where can I put thing like --stacktrace
in the Preferences of Android Studio?
我能做些什么来获得有关发生了什么的更多详细信息,为什么 AndroidStudio Gradle 失败了?我可以把类似--stacktrace
的东西放在Android Studio 的首选项中吗?
回答by Pir Fahim Shah
If you got a problem like this in Android studio, then don't worry about that, you are missing some thing which are here.
如果您在 Android Studio 中遇到这样的问题,请不要担心,您会错过一些这里的东西。
Go to File-->Setting-->Gradle-->Gradle Vm Option, Now put this value -Xmx256min the box, and hit the Apply button.
转到File-->Setting-->Gradle-->Gradle Vm Option,现在将这个值-Xmx256m放入框中,然后点击 Apply 按钮。
Here you have solved the problem.
到这里你已经解决了这个问题。
回答by Ayman Mahgoub
At my case, I forgot to include some jars at Libs folder at the Gradle file, actually I forgot to add ".jar" to the end of jar file name.
就我而言,我忘记在 Gradle 文件的 Libs 文件夹中包含一些 jar,实际上我忘记在 jar 文件名的末尾添加“.jar”。
回答by Hazlo8
In my case, it was not VM Option and Clean and Build did not work. My problem was that there were some images in res folder(so no grammatical errors) and Android Studio/IntelliJ return this error and saying nothing about images... check all external data sourcesin each file.
在我的情况下,它不是 VM Option 并且 Clean and Build 不起作用。我的问题是res 文件夹中有一些图像(所以没有语法错误),Android Studio/IntelliJ 返回此错误并且对图像一无所知......检查每个文件中的所有外部数据源。