iosjavafxgluongluon-mobilejavafxports

GluonVM launching on iOS Device [issues]


I am giving a try of GluonVM on iOS with Oracle JDK 10.2. I have noticed that although I have "com.javasuns.test" in src/ios/Default-Info.plist, when I run the "./gradlew launchIOSDevice" command, the bundle ID is taken from the mainClassName defined in build.gradle.

Here is my example:

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

I have managed to bypass the issue by creating a new java main class named "test.java" under "com.javasuns" package (ignoring that java type names usually start with an uppercase letter).

build.gradle (Changed)

mainClassName = 'com.javasuns.test'

However, now a new error appears that I do not know how to get through it:

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 

Any ideas of how I can solve both issues?


Solution

  • There are two main keys that you have to set properly: CFBundleIdentifier and CFBundleExecutable.

    You can check the sample SingleView-GluonVM:

    and

    or the sample DeepLearning-LinearClassifier, with similar settings.

    As you can see, the Gluon IDE plugin sets by default the CFBundleIdentifier as the main class name and the CFBundleExecutable as the name of your mobile project.

    CFBundleIdentifier

    When you want to deploy your app to iOS, the provisioning profile should have this bundle ID. However, you can also use wildcards. Just make sure you have downloaded and installed to your machine the provisioning profile (it should be under /Users/<user>/Library/MobileDevice/Provisioning Profiles), with extension .mobileprovision.

    If you preview it (from Finder for instance), the AppID from this file could be something like <TEAM ID>.<mainClassName>, or <TEAM ID>.*.

    This is where the jfxmobile plugin sets the appId.

    CFBundleExecutable

    About the CFBundleExecutable, this is the name your application under build/gvm/ will have. It is mandatory in this case that it uses the name of your project (as in the gradle name).

    This is where the jfxmobile plugin sets the appName.

    You will find your app under /<appName>/build/gvm/<appName>.app (though Finder will show just <appName>:

    If you see the content of the app, you will find the executable file under /<appName>/build/gvm/<appName>.app/<appName>:

    The error you are getting;

    [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

    shows testFX.app/TestApp, so probably your project name is testFX, but should be TestApp?

    Alternatively, you can simple match the value you have set in CFBundleExecutable, by adding a settings.gradle file to your project, with:

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