Alpha iOS deployment available in SDK – please test

So, I heard back from the avian developer and he found one bug in my build script and one in avain and now… It works! :smiley:

From the next build on you will be able to install a plugin that allows you to deploy your applications to iOS in your nightly SDK install :slight_smile: Of course, the audio and 3d renderers are still not implemented but the application runs in headless mode and you can try everything else but rendering :wink:

Heres the instructions (also available via F1 in the SDK ofc, it directly opens when the iOS properties panel is opened):
http://wiki.jmonkeyengine.org/doku.php/jme3:ios

Note that the image loader already runs with native code, and beautifully so :smiley:

Cheers,
Normen

12 Likes

This is great news! The sweet little iOS checkbox is one step closer =)

I’ve installed the plugin without any problems at all. Building the iOS project failed though. I have really no experience with iOS and XCode development so it’s hard for me to give you an explanation of what is wrong.

I got two questions when I opened the project (shown in screenshots).



Imgur album http://imgur.com/oI6I8tB,OY8hdPb,lJm5cOl

I maybe missed a step somewhere because I just made a quick test…

3 Likes

Did you do the changes XCode suggests? Cause you shouldn’t for avian afaik :slight_smile: (apart from that image, that doesn’t matter) Also what java version do you have installed? It might be it grabs the java from the system to do some linkage stuff… Or it fails to find its own JDK install… Anyway the native build for the binaries in the SDK looks good? Or is there warnings?

Yeap, I happily did what Xcode suggested… and that did not turn out so good =P
I have both apples java 1.6 and oracles java 1.7 installed on my computer… they are both working but java 7 is the “default java”, I have to change this whenever I do a new project in the SDK (as you know lwjgl+os x+java 7 is not a very good combo in jME atm =P)

Anyway here is the build output from the SDK on a fresh BasicGame with iOS deployment enabled.

ant -f /Users/kwando/jMonkeyProjects/iOS2 clean jar
Building jar: /Users/kwando/jMonkeyProjects/iOS2/build/assets.jar
init:
deps-clean:
Updating property file: /Users/kwando/jMonkeyProjects/iOS2/build/built-clean.properties
Deleting directory /Users/kwando/jMonkeyProjects/iOS2/build
clean:
Building jar: /Users/kwando/jMonkeyProjects/iOS2/build/assets.jar
init:
deps-jar:
Updating property file: /Users/kwando/jMonkeyProjects/iOS2/build/built-jar.properties
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/classes
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/empty
Compiling 1 source file to /Users/kwando/jMonkeyProjects/iOS2/build/classes
compile:
Created dir: /Users/kwando/jMonkeyProjects/iOS2/dist
Copying 1 file to /Users/kwando/jMonkeyProjects/iOS2/build
Copy libraries to /Users/kwando/jMonkeyProjects/iOS2/dist/lib.
Building jar: /Users/kwando/jMonkeyProjects/iOS2/dist/MyGame.jar
To run this application from the command line without Ant, try:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar "/Users/kwando/jMonkeyProjects/iOS2/dist/MyGame.jar"
build-ios:
init:
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/build
Compiling 1 source file to /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/build
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Packaging iOS classpath and resources
ProGuard, version 4.7
Reading program directory [/Users/kwando/Library/Application Support/jmonkeyplatform/3.0RC2/avian-openjdk/classpath]
Reading program directory [/Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/build]
Reading program jar [/Users/kwando/Library/Application Support/jmonkeyplatform/3.0RC2/libs/jME3-ios.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/assets.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/eventbus.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/j-ogg-oggd.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/j-ogg-vorbisd.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-core.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-effects.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-jogg.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-networking.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-niftygui.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-plugins.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-terrain.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty-default-controls.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty-style-black.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/xmlpull-xpp3.jar]
Reading program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/MyGame.jar]
Preparing output jar [/Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/resources.jar]
Preparing output directory [/Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath] (filtered)
  Copying resources from program directory [/Users/kwando/Library/Application Support/jmonkeyplatform/3.0RC2/avian-openjdk/classpath]
  Copying resources from program directory [/Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/build]
  Copying resources from program jar [/Users/kwando/Library/Application Support/jmonkeyplatform/3.0RC2/libs/jME3-ios.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-ios.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/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/kwando/jMonkeyProjects/iOS2/dist/lib/eventbus.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [eventbus.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/j-ogg-oggd.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [j-ogg-oggd.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/j-ogg-vorbisd.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [j-ogg-vorbisd.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-core.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-core.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-effects.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-effects.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-jogg.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-jogg.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-networking.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-networking.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-niftygui.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-niftygui.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-plugins.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-plugins.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/jME3-terrain.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [jME3-terrain.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty-default-controls.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [nifty-default-controls.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty-style-black.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [nifty-style-black.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/nifty.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [nifty.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/lib/xmlpull-xpp3.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [xmlpull-xpp3.jar:META-INF/MANIFEST.MF])
  Copying resources from program jar [/Users/kwando/jMonkeyProjects/iOS2/dist/MyGame.jar]
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [MyGame.jar:META-INF/MANIFEST.MF])
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/MyGame.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/eventbus.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/j-ogg-oggd.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/j-ogg-vorbisd.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/jME3-core.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/jME3-ios.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/jME3-jogg.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/jME3-plugins.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Expanding: /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath/nifty.jar into /Users/kwando/jMonkeyProjects/iOS2/build/ios-classpath/classpath
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/ios-arm/libs
Creating iOS resources object file for arm
Creating iOS bootimage and codeimage for arm
class count 2607 string count 10789 call count 16673
heap size 7513956 code size 5190728
cc1: warning: command line option "-fobjc-legacy-dispatch" is valid for ObjC/ObjC++ but not for C
Expanding libavian.a for arm
ar: /Users/kwando/Library/Application: No such file or directory
Result: 1
Create library list for arm
build-ios-arm:
init:
Created dir: /Users/kwando/jMonkeyProjects/iOS2/build/ios-i386/libs
Creating iOS resources object file for i386
Creating iOS bootimage and codeimage for i386
class count 2607 string count 10789 call count 16673
heap size 7513956 code size 4536484
cc1: warning: command line option "-fobjc-legacy-dispatch" is valid for ObjC/ObjC++ but not for C
Expanding libavian.a for i386
ar: /Users/kwando/Library/Application: No such file or directory
Result: 1
Create library list for i386
build-ios-i386:
The needed native iOS libraries have been built, open the XCode project at ios/project to run the application on iOS.
jar:
BUILD SUCCESSFUL (total time: 29 seconds)
2 Likes

Looks good, did you try recreating the xcode project completely and not changing the compiler?

Oh wait… The ar command fails for some reason, guess I need to add quotes somewhere in the build script. This would explain why it doesn’t find root JVM native methods. Try changing the line that extracts the libavian.a in the ios-impl.xml

Too bad I don’t have a Mac to test this =\

@kwando: Yeah, seems like that was it, if you want to try before the next nightly, replace the -expand-ios-binary target in nbproject/ios-impl.xml with this:
[xml]

Expanding libavian.a for ${ios.arch}






[/xml]

I tracked down that quoting before and the ar command succeeds with the quotes =) However Xcode is still not happy =/

What information is of use for you?

You get the same error in Xcode :? But it does extract the .a file now when you build in the SDK, right? My test setup has no spaces in the name, I guess I’ll have to test it in a deployed SDK build…

Edit: To explain whats happening in the background: The .o files of the project jars and native files have been built and normally the libavia.a would be extracted into separate .o files so the whole classpath and JDK shebang is accessibly to the linker. A list file generated by the build script is being created for that purpose too. Maybe that one didn’t get updated (as it checks for changes in the libavia.a I think). Did you clean and build the project so the library list gets created again?

Okay, tested at home and with a freshly enabled ios deployment option and the fix applied I can run the project on the iPad 6.0 sim directly…? Maybe try running the SDK on java 7? I didn’t quite get if you run on 1.6 or 1.7. Btw, you can just set the jdk folder read rights for “everyone” to “none” to avoid the SDk or other java apps using it, its easier than moving it. The SDK should work on Java7/OSX if you don’t have the heavyweight canvas enabled, but you cannot run applications atm, yeah :frowning:

Did you have a chance to try it again @kwando? I can’t really reproduce the issue with the fix applied.

Now it works! =D Xcode throws a lot of warnings though, but the build succeeds and iPad 6.0 sim starts!

I was running the SDK on 1.7, but after removing read access to that folder and starting the SDK on 1.6 it works.

  1. Creating new BasicGame
  2. Enable iOS deployment
  3. Clean and Build
  4. Open ios/project/jm3-ios.xcodeproj in Xcode
  5. Hit the Run button
  6. Watch the black iPad screen with a big smile knowing what is to come :wink:

The SDK works fine in java7 btw, I can use the scene explorer/editor and such things. Only issue is that new projects defaults to java7 and not java6 when running on java7.

EDIT: Actually the iPad screen is white…

1 Like

Cool, thanks. Yeah the screen is white, thats fine. There is no UI elements yet, only when we have a working renderer we’ll need the gl context. You should be able to see your app do its thing in the log though. Test whatever you can test this way :slight_smile:

The warnings in Xcode are mainly due to the fact that I import the i386 and arm binaries at the same time so that switching between device and emulator is easier, the wrong ones for that build will just be ignored.

1 Like

Will windows user be able to deploy on android as well or like all engine it is mac only?
It will be a big + to j monkey if it is windows compatible

i think you meant iOS not android. And you need a mac + an appstore developer license (was $99/yr, last i checked) if you want to release something. And then an iphone/ipad/ipod to make sure it is actually working properly.

Or send normen $5 and he will distribute/test it for you :slight_smile:

@mathieu.roux222 said: Will windows user be able to deploy on android as well or like all engine it is mac only? It will be a big + to j monkey if it is windows compatible
Yeah, as wezrule said, you can only deploy on mac anyway, theres not much we can do about this. Compiling the libraries should work on any platform but creating an actual iOS application and especially deploying it only works with apples hard- and software. This is so for any corss-platform dev tool (Unity, UDK etc) The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless theres emotes that hint otherwise or there's an increased use of exclamation marks and all-capital words.

Ok so i can’t create iOS game :stuck_out_tongue: i wish Apple would have made Xcode cross platform

@mathieu.roux222 said: Ok so i can't create iOS game :P i wish Apple would have made Xcode cross platform
Yes you can, you just can't *deploy* it :) The content of this post is meant to be read as a straight information or question without an implicit dismissive stance or interest in having the other party feel offended unless theres emotes that hint otherwise or there's an increased use of exclamation marks and all-capital words.

All you need is access to a mac for long enough to build and test.

Android on the other hand you can deploy to from a PC :slight_smile: