【问题标题】:GluonVM launching on iOS Device [issues]GluonVM 在 iOS 设备上启动 [问题]
【发布时间】:2019-09-29 11:12:44
【问题描述】:

我正在使用 Oracle JDK 10.2 在 iOS 上尝试 GluonVM。 我注意到虽然我在 src/ios/Default-Info.plist 中有“com.javasuns.test”,但当我运行 "./gradlew launchIOSDevice" 命令时,包 ID 取自 build.gradle 中定义的 ma​​inClassName。

这是我的例子:

Default-Info.plist

<key>CFBundleIdentifier</key>
<string>com.javasuns.test</string>

build.gradle

dependencies {
     compile 'com.gluonhq:charm:5.0.2'
}

mainClassName = 'test.TestFX'

fxmobile {
    javafxportsVersion = '8.60.12'
    ios { ...... }
}

./gradlew launchIOSDevice

com.gluonhq.higgs.Higgs: non-fatal issue for class javafx.scene.web.JSObjectIosImpl (no known superclass) 
command to dsymutil: xcrun dsymutil -o /Volumes/MyApps/testFX/build/gvm/testFX.app.dSYM /Volumes/MyApps/testFX/build/gvm/testFX.app/testFX 
Error getting ProvisioninedDevices, ignore
created
created
created
created
Error getting ProvisioninedDevices, ignore
created
provprofile asked, bid = test.TestFX and origbid = test.TestFX
provprofile asked, bid = test.* and origbid = test.TestFX
provprofile asked, bid = * and origbid = test.TestFX
No provisioning profile found matching signing identity 'iPhone Developer: #NAME#' and app bundle ID 'test.TestFX'
will return PP null
No provisioning profile found matching signing identity 'iPhone Developer: #NAME#' and app bundle ID 'test.TestFX'
will return PP null
No provisioning profile found matching signing identity 'iPhone Developer: #NAME#' and app bundle ID 'test.TestFX'
will return PP null
Warning, getProvisioningProfile is failing
java.lang.NullPointerException

我已经设法通过在 "com.javasuns" 包下创建一个名为 "test.java" 的新 java 主类来绕过该问题(忽略该 java 类型名称通常以大写字母开头)。

build.gradle(已更改)

mainClassName = 'com.javasuns.test'

但是,现在出现了一个新错误,我不知道如何通过它:

13:17:45:491] BosonAppSupport: Validating codesign... 
[SUB] /Volumes/MyApps/testFX/build/gvm/testFX.app: valid on disk
[SUB] /Volumes/MyApps/testFX/build/gvm/testFX.app: satisfies its Designated Requirement
[13:17:46:269] BosonAppSupport: Validation codesign result: true 
[13:17:46:270] BosonAppSupport: Codesign done 
[13:17:46:333] BosonAppBuilder: UploadInternal start 
[13:17:51:041] : Upload Progress: 10% 
[13:17:51:573] : Upload Progress: 20% 
[13:17:52:104] : Upload Progress: 30% 
[13:17:52:916] : Upload Progress: 40% 
[13:17:53:947] : Upload Progress: 50% 
[13:17:54:696] : Upload Progress: 60% 
[13:17:55:520] : Upload Progress: 70% 
[13:17:56:372] : Upload Progress: 80% 
[13:17:57:367] : Upload Progress: 90% 
[13:17:58:414] : Upload Progress: 100% 
[13:17:58:460] BosonAppBuilder: uploadInternal done 

[13:17:58:796] : Progress: CreatingStagingDirectory [5%] 
[13:17:58:798] : Progress: ExtractingPackage [15%] 
[13:17:58:799] : Progress: InspectingPackage [20%] 
[13:17:58:802] : Progress: TakingInstallLock [20%] 
[13:17:58:804] : Progress: PreflightingApplication [30%] 
[13:17:58:805] : Progress: InstallingEmbeddedProfile [30%] 
[13:17:58:812] : Progress: VerifyingApplication [40%] 
[13:17:58:954] : Error: APIInternalError, Description: Failed to unhide archs in executable file:///private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.LXITKr/extracted/testFX.app/TestApp

> Task :launchIOSDevice
[13:17:58:955] BosonAppBuilder: Installing finished due to an error. 
[13:17:58:958] BosonAppBuilder: Install internal failed 
[13:17:58:958] BosonAppBuilder: Something went wrong. App wasn't installed on the device 

关于如何解决这两个问题的任何想法?

【问题讨论】:

    标签: ios javafx gluon gluon-mobile javafxports


    【解决方案1】:

    您必须正确设置两个主要键:CFBundleIdentifier 和 CFBundleExecutable。

    您可以查看示例SingleView-GluonVM:

    • 主类名(见build.gradle):com.gluonhq.samples.singleviewgvm.SingleViewWithGluonVM
    • CFBundleIdentifier(见Default-info.plist):com.gluonhq.samples.singleviewgvm.SingleViewWithGluonVM

    和

    或示例DeepLearning-LinearClassifier,具有类似的设置。

    如您所见,Gluon IDE 插件默认将CFBundleIdentifier 设置为主类名称,将CFBundleExecutable 设置为您的移动项目的名称。

    CFBundleIdentifier

    当您想将应用部署到 iOS 时,配置文件应具有此捆绑 ID。但是,您也可以使用通配符。只需确保您已将配置文件下载并安装到您的机器上(它应该在 /Users/&lt;user&gt;/Library/MobileDevice/Provisioning Profiles 下),扩展名为 .mobileprovision。

    如果您预览它(例如从 Finder 中),此文件中的 AppID 可能类似于 &lt;TEAM ID&gt;.&lt;mainClassName&gt; 或 &lt;TEAM ID&gt;.*。

    This 是 jfxmobile 插件设置 appId 的位置。

    CFBundleExecutable

    关于CFBundleExecutable,这是build/gvm/ 下的应用程序的名称。在这种情况下,它必须使用您的项目名称(如 gradle 名称)。

    This 是 jfxmobile 插件设置 appName 的位置。

    您会在 /&lt;appName&gt;/build/gvm/&lt;appName&gt;.app 下找到您的应用(尽管 Finder 只会显示 &lt;appName&gt;:

    如果你看到应用程序的内容,你会在/&lt;appName&gt;/build/gvm/&lt;appName&gt;.app/&lt;appName&gt;下找到可执行文件:

    你得到的错误;

    [13:17:58:954]:错误:APIInternalError,描述:无法取消隐藏可执行文件中的拱门:///private/var/installd/Library/Caches/com.apple.mobile.installd.staging/ temp.LXITKr/extracted/testFX.app/TestApp

    显示testFX.app/TestApp,所以您的项目名称可能是testFX,但应该是TestApp?

    或者,您可以简单地匹配您在CFBundleExecutable 中设置的值,方法是将settings.gradle 文件添加到您的项目中:

    rootProject.name = "<your bundle executable value>"
    

    【讨论】:

    • 也许我在这里没有理解某些内容,但是如果我不希望我的“CFBundleIdentifier”与“Main className”相同怎么办。例如,由于某种原因,我需要更改主 java 类名。那么就必须去创建一个新的bundle id,对吧?这是必要的吗?此外,据我目前所注意到的,Apple 的 bundle id 都是非大写字母,而不是必须通过 GluonVM 遵循的形式,即 ..
    • 你是对的。这是当前插件的一个限制。新的 Gluon Client 插件解决了这个问题。虽然它仍在开发中,但您已经可以尝试示例 here。与此同时,您是否设法将您的应用部署到 iOS?
    • 好吧,我刚刚尝试了您在 gradle.properties 中提到的更改,它解决了“APIInternalError”的问题。但是,似乎无法运行预加载器类,虽然RoboVM版本没有问题
    • 嗯,这是一个不同的问题。您可以提交here,但请注意,所有工作现在都在客户端插件中。
    • GluonVM 会被 GraalVM 删除并接管吗?客户端是否支持预加载器?
    猜你喜欢
    • 1970-01-01
    • 2016-11-10
    • 1970-01-01
    • 2019-02-13
    • 2016-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多