ios:createIPA gradle 任务因 HfsCompressor.compressNative 中的错误而失败

ios:createIPA gradle task fails with error in HfsCompressor.compressNative

从命令行为 iOS 构建我的 libGDX 游戏时,使用 ./gradlew ios:createIPA,我有时会收到以下错误:

...
:ios_lite:createIPA
RoboVM has detected that you are running on a slow HDD. Please consider mounting a RAM disk.
To create a 2GB RAM disk, run this in your terminal:
SIZE=2048 ; diskutil erasevolume HFS+ 'RoboVM RAM Disk' `hdiutil attach -nomount ram://$((SIZE * 2048))`
See http://docs.robovm.com/ for more info
RoboVM has detected that you are running on a slow HDD. Please consider mounting a RAM disk.
To create a 2GB RAM disk, run this in your terminal:
SIZE=2048 ; diskutil erasevolume HFS+ 'RoboVM RAM Disk' `hdiutil attach -nomount ram://$((SIZE * 2048))`
See http://docs.robovm.com/ for more info
:ios_lite:createIPA FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ios_lite:createIPA'.
> org.robovm.compiler.util.io.HfsCompressor.compressNative(Ljava/lang/String;[BI)Z

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

BUILD FAILED

--info--debug 提供了更多的输出,但没有更多有用的信息,而 --stacktrace 仅显示了 Gradle.[=18= 中的内部堆栈跟踪]

使用 Gradle 2.2,OS X 10.11.5,JVM 1.8。0_74,RoboVM 1.12.0。

导致此错误的原因是什么,我该如何解决?

我仍然不知道是什么原因造成的(在这方面欢迎更好的回答),但我找到了一个解决方法:重新启动 Gradle 守护程序。在构建之前,只需 运行:

$ ./gradlew --stop

守护程序将在下一次构建时自动重启。到目前为止,这个解决方法已经为我可靠地修复了错误。