How should I start with IOS?


#21

is there a flag to disable proguard like there is in android? (yea, I had to use that…)


#22

which library jars are including in your app?


#23


Edit: Click for while picture; the forum seems o crop it.
Edit #2 condensed dependencies.

New error:

Creating iOS resources object file for arm
Creating iOS bootimage and codeimage for arm
/Users/indigo/Documents/JMonkeyEngine/Crushed/nbproject/ios-impl.xml:5: The following error occurred while executing this line:
/Users/indigo/Documents/JMonkeyEngine/Crushed/nbproject/ios-impl.xml:179: exec returned: 255
BUILD FAILED (total time: 3 minutes 57 seconds)

#24

No, imgur was cropping it because you used the landing page URL instead of the actual image URL. I fixed it for you.


#25

You need to strip it right down. Clearly some of the libraries you are using don’t work.
You don’t need DESKTOP for iOS.
Never tried lemur. All my GUI was done in XCODE with native GUI. I could never get NIFTY or TONEGOD to work in iOS so i didn’t use any jMonkey GUI.
No idea about Lemur but I’m sure it will have the same issues.
Some of the libraries you are using I don’t even recognise.
SVG???
JMEInterface???
GUAVA???
SLF4J API?

I would recommend ripping them all out and compile with the standard libraries and add them back in one at a time and find out which one fails.
If I was to guess Lemur is the culprit.


#26

Lemur is just using JME objects. Mesh, Geometry, etc…

If you leave out the groovy stuff there is generally no special issues. It’s even using standard JME materials.

On Android, only the groovy style stuff causes any problems and they are surmountable there, I guess. Some of the groovy files just need to be merged, etc…

Edit: but if it is Lemur then it’s likely a similar “duplicate resources” thing… that’s going to be relatively common among third party jars, I think.


#27

SVG & JMEInterface are my own libraries.



Out of these libraries, SVG would be the most likely one. It dosen’t have an iOS implementation, so it defaults to AWT.
BUUUUUUT…
The problem is happening in the JMP; not XCODE so I doubt this.

Guava & slf4j are used by lemur. And I cant test if that is the problem without destrying my entire UI

I’ll try making a new project and seeing if it compiles to ios. Seems like a good place to start


#28

The real problem here is the output. Could you maybe show us line 179 of ios-impl.xml, so we can see what command exatly failed?


#29

174-186

<target name="-make-ios-bootimage" unless="ios.images.uptodate" depends="-check-images-uptodate" description="Creates the iOS boot image and code image">
        <mkdir dir="${ios.build.libs.dir}"/>
        <delete file="${ios.build.bootimage.o}"/>
        <delete file="${ios.build.codeimage.o}"/>
        <echo>Creating iOS bootimage and codeimage for ${ios.arch}</echo>
        <exec executable="${ios.avian.bootimage-generator}" failonerror="true"> //179
            <arg line="-cp ${ios.build.classes.dir}"/>
            <arg line="-bootimage ${ios.build.bootimage.o}"/>
            <arg line="-codeimage ${ios.build.codeimage.o}"/>
        </exec>
        <touch file="${ios.images.checkfile}" verbose="false"/>
    </target>

#30

then you should copy the commandline and try to execute it like that and see what the error is.


#31

how did you get on?


#32

I’m not really sure what the question is here…


#33

I was wondering if you managed to get the basic project to compile on iOS. I’m happy to help with the iOS side and with the guide I put together. I was however, making the assumption in my guide that you had a successful compile at least before trying to get it to work on Apple devices. Let me know if you need any help once you get to that point.


#34

Well the game itself compiles. Just not the ios part. I can’t seem to make it find jni.h


#35

What version of Xcode do you have installed?

Send the full error log.


#36

XCode 10.2 beta 3 with cmd line tools

Log for clean & build:

ant -f /Users/indigo/Documents/JMonkeyEngine/BasicGame -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/built-clean.properties
Deleting directory /Users/indigo/Documents/JMonkeyEngine/BasicGame/build
clean:
Building jar: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/assets.jar
init:
deps-jar:
Updating property file: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/built-jar.properties
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/classes
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/empty
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/generated-sources/ap-source-output
Compiling 1 source file to /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
compile:
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/dist
Copying 1 file to /Users/indigo/Documents/JMonkeyEngine/BasicGame/build
Copy libraries to /Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib.
Building jar: /Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/MyGame.jar
To run this application from the command line without Ant, try:
java -jar "/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/MyGame.jar"
build-ios:
init:
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/build
Compiling 1 source file to /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/build
Copying 1 file to /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/build
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Packaging iOS classpath and resources
ProGuard, version 5.2.1
Reading program directory [/Users/indigo/Library/Application Support/jmonkeyplatform/v3.2.2-stable-sdk1/avian-openjdk/classpath]
Reading program directory [/Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/build]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/assets.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/gson-2.8.1.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/j-ogg-all-1.0.0.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-2.0.5.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-linux.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-osx.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-windows.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-bullet-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-core-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-effects-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-ios-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-jogg-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-networking-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-plugins-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-terrain-3.2.2-stable.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jutils-1.0.0.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-2.9.3.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-linux.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-osx.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-windows.jar]
Reading program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/MyGame.jar]
Preparing output jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/resources.jar]
Preparing output directory [/Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath] (filtered)
  Copying resources from program directory [/Users/indigo/Library/Application Support/jmonkeyplatform/v3.2.2-stable-sdk1/avian-openjdk/classpath]
  Copying resources from program directory [/Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/build]
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/assets.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [assets.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/gson-2.8.1.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [gson-2.8.1.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/j-ogg-all-1.0.0.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [j-ogg-all-1.0.0.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/services/javax.sound.sampled.spi.AudioFileReader] (Duplicate zip entry [j-ogg-all-1.0.0.jar:META-INF/services/javax.sound.sampled.spi.AudioFileReader])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-2.0.5.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jinput-2.0.5.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-linux.jar]
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-osx.jar]
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jinput-platform-2.0.5-natives-windows.jar]
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-bullet-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-bullet-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-core-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-core-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-effects-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-effects-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-ios-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-ios-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-jogg-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-jogg-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-networking-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-networking-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-plugins-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-plugins-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jme3-terrain-3.2.2-stable.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jme3-terrain-3.2.2-stable.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/jutils-1.0.0.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jutils-1.0.0.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-2.9.3.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [lwjgl-2.9.3.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-linux.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [lwjgl-platform-2.9.3-natives-linux.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-osx.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [lwjgl-platform-2.9.3-natives-osx.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/lib/lwjgl-platform-2.9.3-natives-windows.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [lwjgl-platform-2.9.3-natives-windows.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/indigo/Documents/JMonkeyEngine/BasicGame/dist/MyGame.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [MyGame.jar:META-INF/MANIFEST.MF])
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/MyGame.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/gson-2.8.1.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/j-ogg-all-1.0.0.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-bullet-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-core-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-ios-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-jogg-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-plugins-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Expanding: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath/jme3-terrain-3.2.2-stable.jar into /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-classpath/classpath
Created dir: /Users/indigo/Documents/JMonkeyEngine/BasicGame/build/ios-arm/libs
Creating iOS resources object file for arm
Creating iOS bootimage and codeimage for arm
class count 3804 string count 14640 call count 27729
heap size 12781312 code size 9422188
Compiling native code for arm
/Users/indigo/Documents/JMonkeyEngine/BasicGame/ios/src/JmeAppHarness.m:32:10: fatal error: 'jni.h' file not found
#include <jni.h>
         ^~~~~~~
1 error generated.
/Users/indigo/Documents/JMonkeyEngine/BasicGame/

#37

In the screen where you enable iOS there is a version number combo box.

The default is ‘DEFAULT’. You need to choose a specific version or it may not compile.

If I selected default it brings up a different error but it fails in the same place.


#38

Was set to iOS 12


#39

Well if #include <jni.h> doesn’t work it means you lack a jdk which is installed so that the header file is in the system search path.
https://stackoverflow.com/questions/21574142/jni-headers-not-found-from-xcode maybe something like this helps?
Have you tried googleing?

Maybe you need to install a new jdk on your system if you had any?


I could swear that this include path is already configured, but maybe for java 5 and nowadays mac os ships with java 8


#40

you might struggle to find jdk 7 now. jdk 8 should also work fine.

Download it from here:
JDK 8 u202

Don’t forget to update your JDK in Project Settings/Libraries/Manage Platforms

Leave the source binary format as JDK 7 though.
image