It failed here in the simulator because proguard stripped some of the java.net. classes. I added them to the ‘keep’ exceptions and it worked in the simulator and continued on to work ok,
When I try it on an IPAD device it fails here at this same place.
Any ideas?
Hard to say without log. But if you say it runs in the simulator and fails on your iPad, then it could be a 64 bit problem. Has your iPad a 64 bit CPU? Then change architectures to ARM only. (Of course you cannot submit such an app, because of the ARM64 requirement.)
Are you using the latest iOS plugin? I could get the default project running on my 64 bit iPad exactly once, but now it fails. Still investigating…
Im just using the standard handshake message from monekyzone and the register class (at bottom).
wont run on IOS device.
@Serializable()
public class HandshakeMessage extends AbstractMessage {
public int protocol_version;
public int client_version;
public int server_version;
public HandshakeMessage() {
}
/**
*
* @param protocol_version
* @param client_version
* @param server_version
*/
public HandshakeMessage(int protocol_version, int client_version, int server_version) {
this.protocol_version = protocol_version;
this.client_version = client_version;
this.server_version = server_version;
}
private static final Logger LOG = Logger.getLogger(HandshakeMessage.class.getName());
Which iOS plug-in version are you using? (Old version does not disable JIT which is required for reflections)
Does it run on a 32bit device or 64bit device?
And where does it fail? (32 or 64 bit device)
Without further log, I guess you need to disable JIT (Item 5), because registerClass() uses reflection.
As a note, when disabling the iOS deployment and deleting the ios folder, make sure you also delete the ios folder in “resources” manually, otherwise the new application base for iOS might not be installed (the deployment keeps any files that are different from the ones it installs).
This is my entire code, as you can see its the basic game template with 1 additon for register class. The message that is being registered is above in the thread.
I’m disabling reflection using the ‘threshold’ option as in the current IOS plugin.
Im using XCODE 6.1.1 with SDK 8.1 IOS Plugin 3.0.0.1567 (latest), Im using 1.7JDK
How can I check if I using correct version of Avian?
Also, has anyone tried using JME networking with the new Avian and SDK 8.1 etc??
@author normenhansen
*/
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
Serializer.registerClass(HandshakeMessage.class);
Box b = new Box(1, 1, 1);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
Oh, I think you already provided the relevant information above. Java’s zip implementation uses ISO-8859-1 encoding, but Avian does only support UTF-8. (I think this is against the spec.)
For zip I have a workaround. (Or to be precise for the previous SDK iOS plug-in. I’ll try to get it running with the new version. I’ll add it to my list if I have success.)
But in general it’s not always possible to provide a workaround. For example I could not get Properties.load() running. Maybe it’s time to contact the Avian developer.
thanks for preserving my sanity. However, the question I ask with dread is, “Is there any thing I can do to get it working for now or do I have to put IOS on hold?”
I will contact Avian developer too but how long do you think it would be before you could address it?
Could I, should I roll back to a previous SDK? If so, which works and is it still available?
Added my workaround to the list (item 4) for previous SDK iOS plug-in. Sorry, but I can’t tell you if this fixes your problem. Your registerClass() still fails…
I think you’ll have to add log messages (to the jme3 classes) until you know exactly the line which fails…
Bad news: Looks like that ARM64 does not run. After adding ARM64 to architectures the app crashes. I guess an option is missing somewhere? (I played around with no success)
The default project runs until you click “autofix settings” or add ARM64.
Theres been some fixes for JNI calls on avian just yesterday, I committed a build of that, should be in the update center. Make sure you go to the iOS settings page of a project once to install the new avian compiler.
Latest iOS plug-in makes the default project run with ARM64! Thanks!!!
Unfortunately I have to turn off logging in JmeAppHarness.java, otherwise it crashes in DecimalFormat.applyPattern().
I haven’t changed logging or something, it’s the pure default project. It was only my guess that logging uses DecimalFormat somewhere. And I could be wrong, but turning logging off helped.
ARM64 crashes if some ogg files are loaded. It doesn’t crash after loading one file,
but the more files are loaded the more likely it is.
The ogg files do not seem to play a role, I just replaced my files with randomly chosen from jME.
public void simpleInitApp() {
// sounds from jME3-testdata.jar and nifty-examples.jar
new com.jme3.audio.AudioNode(assetManager, "Beep.ogg", false);
new com.jme3.audio.AudioNode(assetManager, "intro.ogg", false);
new com.jme3.audio.AudioNode(assetManager, "Foot steps.ogg", false);
new com.jme3.audio.AudioNode(assetManager, "a.ogg", false);
// Still no crash? Add more files...
}
Annotations are also not supported on iOS!!! I once met that fact some time ago, but didn’t feel the need to write it down. (I registered a nifty listener through an annotation, but in this case the error message was quite self explaining.)
Reproducible with:
Main.class.isAnnotationPresent(Serializable.class); // works fine (Main class has no annotations)
HandshakeMessage.class.isAnnotationPresent(Serializable.class); // crashes
com.jme3.network.serializing.Serializer.registerClass() uses isAnnotationPresent() and getAnnotation() etc…
Currently I don’t know a workaround.