I’ve just started experimenting with building for iOS, and ran into a problem with avian-openjdk out of the box.
I’m on OSX 10.11.4 with Xcode 7.3.
I installed the latest SDK, 3.1-pony (3.1-alpha4).
Created a new default project and checked it ran ok.
Went to Project Properties => Application => iOS, checked ‘Enable iOS deployment’ with ‘iOS SDK Version’ 9.3
I get the error below but nothing in the log, even at FINE.
I can see that the avian-openjdk directory is created in "Application Support/jmonkeyplatform/3.1.0-alpha4, but it contains only one file, .zipextversion. If I delete avian-openjdk, then disable and re-enable the iOS build the same thing happens.
Any suggestions or attempts to reproduce would be much appreciated.
I’ll take a look into it.
I actually experienced the Same Issue when adding iOS Support, but I couldn’t reproduce it.
This is because it’s downloaded to Application Support/ which is where I didn’t look into
Unfortunately the SDK Code uses Exceptions.printStackTrace() quite often which only prints to STDOUT, so you might see something when running it from Console.
btw: If you want to get rid of pink, just see our “Darkmonkey as SDK Default” Thread on how to change the color scheme.
This is the error I get when running the avian package build script.
removing build directories
makefile:819: *** “couldn’t find SDK”. Stop.
/Users/ant/Desktop/installs/sdk-master/jme3-ios/build.xml:58: exec returned: 2
BUILD FAILED (total time: 1 second)
I see what you mean, but even if I did manage to get Avian to update with the PACKAGE AVIAN build script that would mean the JmeAppHarness would still be the unported/old one so are we saying that it wouldn’t work anyway?
The ‘Unable to insert branch island’ error is because the boot image created is over the maximum size. I guess you knew that.
One thing you should try is by supplying the lzma= argument to the MAKE. You should use version 920.
When I try to add LZMA into the build.xml it complains because there is no specified target. When it comes to creating targets for the ANT build I’m a bit lost so if you can do that then I believe the images will be compressed during the build so should bring it under the maximum.
Also, the existing PACKAGE-AVIAN doesn’t use pro guard until after the images have been created and just before creating the ZIP file. The problem as you know it doesn’t get that far because it can’t create the ARM image at all. There is a switch ‘use-proguard’ in MAKE but again I’m not able to implement that in the build.xml.
I did manage to build the images by using the ANDROID libraries which I know is not going to work, but it at least let me create the AVIAN-OPENJDK-MAC.zip and add it in.
Then I discovered that if you build then it fails because JMEAPPHARNESS.class is now build using JDK 1.8 level. Therefore it complains that the version of the class is 52 which v1.8 and should be 51.
I added -source=1.7 and target=1.7 in the specific part that builds the native java classes and that worked. The reason this is a problem is because 3.1 is compiling with JDK 1.8 and the JAVAC parameters are not pulled from the properties file (only for native compile).
Then I discovered that the IOS.PROPERTIES needs to be re-done to match the new JAR files.
One more point is that the HELLO.IOS project that the IOS project is based on has been completely re-written due too many depreciations in XCODE so that will need to be re-integrated too.
That’s all I’ve got for now but if someone is able to implement the LZMA option into the ant build then it’s a good start.
Well my approach was much simpler:
I used Avian from jME 3.0 installation and I could patch and compile my project.
BTW That was jME 3.1-alpha-1.
The patch was:
JmeAppHarness.java: replace IGLESShaderRenderer with GLRenderer, replace onFrame() with postFrame()
But as I suspected that just makes it compilable. The app crashes with:
Thread 1Queue : com.apple.main-thread (serial)
#0 0x0024eb10 in com/jme3/renderer/opengl/GLRenderer.loadExtensions()Ljava/util/HashSet; ()
#1 0x0024f6b8 in com/jme3/renderer/opengl/GLRenderer.loadCapabilitiesCommon()V ()
#2 0x00252058 in com/jme3/renderer/opengl/GLRenderer.loadCapabilities()V ()
#3 0x002521e8 in com/jme3/renderer/opengl/GLRenderer.initialize()V ()
#4 0x002bdcbc in com/jme3/system/ios/IGLESContext.create(Z)V ()
#5 0x0017a4c4 in com/jme3/app/Application.start(Lcom/jme3/system/JmeContext$Type;Z)V ()
#6 0x0017a170 in com/jme3/app/Application.start()V ()
#7 0x0017d8cc in com/jme3/app/SimpleApplication.start()V ()
#8 0x0067a558 in JmeAppHarness.<init>(J)V ()
So my guess was that someone of the core team has to look at it. IIRC I posted the stacktrace above already somewhere and I was told that @Kostyantyn could fix it.
That was almost one year ago. But now I’m glad, that there are already two of us.
So you aren’t forgotten, I tried my best and could at least work around a few bugs with the awesome help of the avian team.
There seems to be a bug though in XCode 6’s clang which prevents me from supplying avian’s i386 architecture. This is only relevant for the iOS Simulator though, so you simply have to build for x86_64 when you want the Simulator.
Anyway after now having fixed all of this which I will commit in the following few days.
If you have such a problem then run it in Debug on the iOS Simulator, it’d show you:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
→ This is a classical NPE in LoadExtensions(HashSet).
I don’t know why we can’t catch that Exception, probably because it’s in the contructor.