Building On iOS.

There are a couple of updates required to the standard XCODE project generated by the system in order to build correctly.

  1. After creating a Basic Game project in the jMonkeyEngine SDK, add the iOS library by RMB selecting your project and navigating to Properties ▸ Libraries ▸ Add Library…​ ▸ jme3-ios and when ready Add Library .

    xcode_add_ios_lib.jpg
  2. In Properties ▸ Application ▸ IOS enable iOS deployment and make sure the iOS SDK Version is showing a number (Not Default). If there is no number present then you need to install XCODE. In this example, my SDK version is 11.3 and I’m using XCODE version 9.3

    xcode_enable_ios_deploy.jpg

    When you press OK, after enabling iOS deployment and if not already installed, “AVIAN” will download and install. This is shown in the bottom status bar of the JME editor. Wait until this is finished before doing anything else.

  3. Compile your project. If it’s missing stdio.h you need to install the xcode command line tools.

    1. Run this command in terminal:

      xcode-select --install
    2. When it’s compiled successfully, load the XCODE PROJECT into XCODE, which is located in the IOS/PROJECT folder. As mentioned above, my SDK version is 11.3 and I’m using XCODE version 9.3

  4. First change the selected “TARGET” at the top of the screen from iPhone 7 Plus to Generic iOS Device. This is so we can do a full build. If you want to run it in a simulator then you can change it back later.

    xcode_generic_ios.jpg
  5. From the “PROJECT” menu click BUILD and the build will fail. Click the ISSUE NAVIGATOR button to show the compilation errors.

    xcode_issue_nav.jpg

    We can see here that the “Developer” account is missing, the project settings are out of date and there is a missing image for Retina 4-inch support.

    1. Click Validate Project Settings followed by PERFORM CHANGES to accept all the suggested amendments.

      xcode_perform_changes.jpg
    2. Click on the Missing Image warning and XCODE will automatically add a placeholder for you.

      xcode_add_placeholder.jpg
    3. Add your iOS developer account details by clicking on the target and then the Account Drop down.

      xcode_add_account.jpg
  6. Now click the PROJECT menu and BUILD again and it should compile now but fails at the linking stage.

    xcode_build.jpg
  7. We need to amend the linker search paths.

    1. Click on PROJECT NAVIGATOR.

    2. Highlight the top row (JME-IOS).

    3. Click jme-ios under “PROJECT” (Not “TARGETS”).

      If you have done it correct then you will only see “INFO” & “BUILD SETTINGS” at the top.

    4. Select BUILD SETTINGS.

    5. Scroll down to “LINKING” section.

      xcode_linking.jpg
    6. Double click on OTHER LINKER FLAGS.

      xcode_linker_flags.jpg
    7. Double click on the line referencing “i386” and change it from:

      …/…/build/ios-i386/libs.list

      to

      …/…/build/ios-x86_64/libs.list

    8. Add the additional flag for “ARM64” sub type issue introduced in iOS SDK 11.

      • With nothing selected click on the + sign and a new entry will be added at the bottom.

      • In here add:

        -force_cpusubtype_ALL

      Your other linker flags should now look like this…

      xcode_other_linker.png
  8. Disable “BITCODE”.

    1. Click on PROJECT NAVIGATOR.

    2. Highlight the top row (JME-IOS).

    3. Click jme-ios under “TARGETS” (Not “PROJECT”).

      If you have followed the directions correctly, then you will see General/Capabilities/Resource Tags/Info/Build Settings/Build Phases/Build Rules at the top.

    4. Select BUILD SETTINGS.

    5. Scroll down to “BUILD OPTIONS” section and change “ENABLE BITCODE” to “NO”.

      xcode_disable_bitcode.jpg
  9. From the “PROJECT” menu click "BUILD" and the project should build and link fully.

  10. To publish to the “APP STORE” you select PROJECT ▸ ARCHIVE.

    This will generate the App Store Archive and show in the organizer screen.

    xcode_publish.png
  11. Click Upload to APP Store and away you go.

You can follow the forum post on this subject here.