简体   繁体   English

Gluon Mobile无法移植到iOS

[英]Gluon Mobile Not Being Able to Port to iOS

I'm on the home stretch of this App I'm working on and I can't seem to get it to port to iOS. 我正在研究此应用程序,但似乎无法将其移植到iOS。 When trying to build my application on iOS, I get an OutOfMemory exception over and over again. 尝试在iOS上构建应用程序时,我一遍又一遍地遇到OutOfMemory异常。

Then I tried to build a basic Gluon Mobile application and port it to iOS and I get this: 然后,我尝试构建一个基本的Gluon Mobile应用程序并将其移植到iOS,我得到了:

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:createDefaultIOSLauncher UP-TO-DATE
:compileIosJava UP-TO-DATE
:processIosResources UP-TO-DATE
:iosClasses UP-TO-DATE
:iosExtractNativeLibs UP-TO-DATE
: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
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
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
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
Warning: javax.xml.bind.annotation.XmlRootElement is a phantom class!
Warning: java.nio.file.StandardOpenOption is a phantom class!
Warning: java.nio.file.FileSystem is a phantom class!
Warning: java.nio.file.OpenOption is a phantom class!
Warning: java.nio.file.FileSystems is a phantom class!
Warning: com.oracle.jrockit.jfr.TimedEvent is a phantom class!
Warning: com.oracle.jrockit.jfr.EventToken is a phantom class!
Warning: com.oracle.jrockit.jfr.ValueDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.EventDefinition is a phantom class!
Warning: com.oracle.jrockit.jfr.Producer is a phantom class!
Warning: com.oracle.jrockit.jfr.FlightRecorder is a phantom class!
Daemon stopping because JVM tenured space is exhausted
Daemon stopping because JVM tenured space is exhausted

My IMac is running 8GB of RAM on a 2.7GHz I5. 我的IMac 在2.7GHz I5上运行8GB RAM。

I have also attempted mounting a RoboVM RAM Disk to no success. 我也尝试安装RoboVM RAM磁盘未成功。 Please help! 请帮忙!

Usually, the iOS deployment requires a lot of memory, and it is a good practice to increase by default the maximum allocation memory pool of the JVM heap, up until 2 GB. 通常,iOS部署需要大量内存,并且默认情况下,将JVM堆的最大分配内存池增加到2 GB是一种很好的做法。

Running from your IDE, you can set this default value in the Gradle preferences. 从IDE运行,您可以在Gradle首选项中设置此默认值。

For instance, on NetBeans, go to Preferences->Miscellaneous->Gradle, Scripts & Tasks, and as Gradle JVM arguments add -Xmx2048m : 例如,在NetBeans上,转到Preferences-> Miscellaneous-> Gradle,Scripts&Tasks,然后在Gradle JVM参数中添加-Xmx2048m

Gradle参数

Another option is to set a gradle property in your gradle.properties file (the one with the ANDROID_HOME property, under <user>/.gradle ): 另一种选择是在gradle.properties文件中设置gradle属性(在<user>/.gradle下具有ANDROID_HOME属性的属性):

org.gradle.jvmargs=-Xmx2048m

This property file will be applied either running from IDE or from command line, so it is more appropriate. 该属性文件将应用于从IDE运行或从命令行运行,因此更合适。

A typical situation where an out of memory error is found is the first time the RoboVM compiler is launched. 发现内存不足错误的典型情况是第一次启动RoboVM编译器。 Luckily, all the compiled classes are cached, so restarting the task just resumes the process. 幸运的是,所有已编译的类都已缓存,因此重新启动任务只会恢复该过程。

Also, if the process fails, sometimes can be convenient to stop all the deamon threads with gradle --stop and ./gradlew --stop , and start the task again. 另外,如果该过程失败,有时可以很方便地使用gradle --stop./gradlew --stop停止所有gradle --stop进程线程,然后重新启动任务。

If the process ends successfully, even if there are warning messages, just check on your iOS device that the app was installed and runs fine. 如果该过程成功结束,即使有警告消息,也只需在您的iOS设备上检查该应用程序已安装并运行正常。 Note that you could find memory issues as well, but this is a different issue. 请注意,您也可能会发现内存问题,但这是一个不同的问题。

Edit 编辑

when running long tasks, it's always convenient using --info to find out more about the process, with a more verbose output. 当执行长任务时,使用--info查找有关该过程的更多信息总是很方便,并且输出更为详细。

Also, the process can be run from the console (from NetBeans, right click on the build.gradle file and select Tools->Open in Terminal). 另外,可以从控制台运行该过程(从NetBeans中,右键单击build.gradle文件,然后选择“工具”->“在终端中打开”)。

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

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