rjahn
rjahn

Reputation: 468

Building iOS application not possible (StackOverflowError)

MacOS, Eclipse 4.7 + Gluon Plugin, Java 9

Created a simple Demo Application with GluonVM and tried to launchIPhoneSimulator:

After a while, a StackOverflowError came up:

Working Directory: /tools/eclipse_workspace/MobileTest/MobileTestApp
Gradle User Home: /Users/rjahn/.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 4.3.1
Java Home: /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: launchIPhoneSimulator

:MobileTestApp:compileJava UP-TO-DATE
:MobileTestApp:processResources UP-TO-DATE
:MobileTestApp:classes UP-TO-DATE
:MobileTestApp:compileIosJava NO-SOURCE
:MobileTestApp:processIosResources NO-SOURCE
:MobileTestApp:iosClasses UP-TO-DATE
:MobileTestApp:launchIPhoneSimulatorSetting gloal LogLevel to INFO

Configure logging for GVM tooling... BUNDLE ID = com.sibvisions.mobile.test.Application
[HIGGS] Creating higgs...
[09:13:23:597] com.gluonhq.higgs.Higgs: [HIGGS] mainClassName = com/sibvisions/mobile/test/Application 
[09:13:23:624] com.gluonhq.higgs.Higgs: [HIGGS] arch = x86_64
missing file /tools/eclipse_workspace/MobileTest/MobileTestApp/build/classes/java/ios
[09:13:24:855] com.gluonhq.higgs.Compiler: compilation, round 0 
[09:13:24:856] com.gluonhq.higgs.Higgs: Still compiling... 11173 classes left. 
[09:13:34:857] com.gluonhq.higgs.Higgs: Still compiling... 4375 classes left. 
[09:13:41:107] com.gluonhq.higgs.Compiler: halfway done round 0 
[09:13:41:426] com.gluonhq.higgs.Compiler: done round 0 
[09:13:41:427] com.gluonhq.higgs.Compiler: compilation, round 1 
[09:13:44:858] com.gluonhq.higgs.Higgs: Still compiling... 488 classes left. 
[09:13:45:262] com.gluonhq.higgs.Compiler: halfway done round 1 
java.lang.StackOverflowError
    at java.base/java.util.HashMap.putVal(HashMap.java:631)
    at java.base/java.util.HashMap.put(HashMap.java:612)
    at java.base/java.util.HashSet.add(HashSet.java:220)
    at com.gluonhq.higgs.DependencyGraph.visitReachableNodes(DependencyGraph.java:170)
    at com.gluonhq.higgs.DependencyGraph.visitReachableNodes(DependencyGraph.java:173)
    at com.gluonhq.higgs.DependencyGraph.visitReachableNodes(DependencyGraph.java:173)
    at com.gluonhq.higgs.DependencyGraph.visitReachableNodes(DependencyGraph.java:173)

Upvotes: 1

Views: 110

Answers (1)

José Pereda
José Pereda

Reputation: 45476

Check this doc for known issues when starting with Gluon VM.

Also check this readme for hints on how to get started with the jfxmobile plugin 2.0.29+ for Gluon VM.

As you can see in bullet 4 for iOS,

It is highly recommended to increase the Java stack size, by adding the following option to the ~/.gradle/gradle.properties file.

Edit the /Users/<your user>/.gradle/gradle.properties file and add:

org.gradle.jvmargs=-Xms256m -Xmx4096m -Xss2m

Also make sure that you are running the latest version of the plugin.

Check that your build.gradle file is using:

classpath 'org.javafxports:jfxmobile-plugin:2.0.29'

Now try again the launchIPhoneSimulator task.

Be aware of this note as well:

The first time the plugin runs an iOS task, it will take a long time (more than 15 minutes) to ahead-of-time compile all the Java modules. After this finishes successfully, all these modules are cached locally (~/.gvm/aot), so the next runs will be shorter (just a few minutes).

Upvotes: 1

Related Questions