![](/img/trans.png)
[英]Using iOS Swift & Android Libraries that rely on Bluetooth Low Energy with Gluon-Mobile
[英]MultiView FXML Project on iOS using Gluon-mobile and Java9
創建一個全新的MultiView FXML項目,然后在Gradle中添加Java9必需品:
buildscript {
repositories {
jcenter()
google()
maven{
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.5'
}
}
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
dependencies {
compile 'com.gluonhq:charm:4.4.0-jdk9'
androidRuntime 'com.gluonhq:charm:4.4.1'
compile 'com.airhacks:afterburner.mfx:1.6.3'
// Added because of javax.annotation.PostConstruct Java9 issues
compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.2.6'
}
導致線程“ JavaFX Application Thread”中的[SUB]異常java.lang.IllegalStateException:在顯示對話框之前必須顯示階段。
該項目可以在台式機和Android上正常運行,但不能在iOS模擬器和設備上運行。 我已經嘗試了很多方法,但是由於這個錯誤是在新創建的項目中發生的,因此我相信這是由gluon-mobile和Java9的相互作用引起的。
獎勵:僅將jfxmobile-plugin更改為2.0.18甚至無法通過以下命令進行編譯:
[15:08:15:141] com.gluonhq.higgs.Higgs:仍在編譯...還剩8823個課程。
[15:08:25:143] com.gluonhq.higgs.Higgs:仍在編譯...還剩4152類。
[15:08:34:389] com.gluonhq.higgs.Compiler:在0 java.lang.StackOverflowError回合中途完成
在java.base / java.util.HashMap.putVal(HashMap.java:642)
在java.base / java.util.HashMap.put(HashMap.java:612)
在java.base / java.util.HashSet.add(HashSet.java:220)
在com.gluonhq.higgs.DependencyGraph.visitReachableNodes(DependencyGraph.java:170)
這些步驟對我有用:
使用Java 9和帶有Gluon IDE插件2.6.2的NetBeans 9(測試版),我創建了一個Gluon項目(帶有FXML的多視圖)。 當然,這也將與其他IDE一起使用。
我檢查了gradle包裝器是否使用4.3.1(或更高版本)。
我修改了build.gradle
文件以將build.gradle
VM與jfxmobile 2.0.18結合使用:
build.gradle
文件:
buildscript {
repositories {
jcenter()
google()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.18'
}
}
並更新了依賴項:
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile 'com.gluonhq:charm:4.4.0-jdk9'
compile 'com.airhacks:afterburner.mfx:1.6.3'
compile 'javax.annotation:javax.annotation-api:1.3.2'
androidRuntime 'com.gluonhq:charm:4.4.1'
}
請注意,清理~/.gvm
緩存可能會很方便,因為它可能包含舊版本中的不再使用的類。 當然,您還應該清理項目./gradle
和/build
文件夾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.