Badger code sample does not run on iOS 10 when compiled on El Capitan?

Hi all,


I've donwloaded the Badger code sample and compiled it using XCode 8 beta on my MacBook Pro Retina 16GB running El Capitan. Of course, I cannot run it on the mac because it requires Sierra. However, even when I try to run it on iOS10 the code fails, both on the simulator and on an actual iOS 10 device (iPad mini). Specifically, it stops before the guard loading the scene can even terminate. Any hint?


Thanks in advance!

Answered by jijioben in 154632022

Quick update: I installed the new beta of iOS 10 on my iPad Mini 2 and without recompiling or reinstalling it worked. There must have been a bug that prevented the sample to work on some configurations.


I am installing the new Xcode too, and will see if it works on the simulator too.

hello


I just tried the sample code on an iPad mini 2 and it works fine.

It's surprising that you were able to run it on an iPad mini since it shouldn't be supported by iOS 10 according to http://www.apple.com/ios/ios10-preview/

Thanks for your answer.


Yes it is an iPad mini 2 - forgot to add the number at the end. The error I get consistently, both in the simulator and on the device is "EXC_BAD_ACCESS" at line 38 of ViewController.swift for Thread 1 with code=1, address = 0x0. I am running OS X v 10.11.5. I should say that I have both Xcode 7.3.1 and Xcode 8 beta installed. Since this error seems to be uncommon, I'll try a fresh install.

I'm getting exactly the same problem, Xcode 8.0 beta 8S128d, OS X 10.11.5

Badger crashes when compiled for iOS 10 and run on the iphone simulator.


The crash happens when instantiating SCNScene with scene.scn.


I think it could be a simulator problem because compiling for tvOS and running on that simulator seems to get past that stage (although the tvOS simulator is too slow to run the app)


Some other strange things:

- A lot of the .scn files have image files associated for the Scene Background and Lighting Environment properties (ie. Background_sky.png and sky_cube.exr respectively), but there is no way to change it in the Xcode interface because the Scene Inspector only allows selection of colors. If you look inside the .scn files as binary, you can see the full paths to those files from the Apple developer's machine (or whoever developed the Badger app) hardcoded inside (file:///Users/toyos/dev/Melon/sample-codes/WWDC2016/badger/Game%20assets/badger.scnassets/textures/Background_sky.png)


- scene.scn also references other .scn files (eg. Collectables references collectable-small.scn) but those locations are also hardcoded absolute paths to the Apple developer's machine. You can also see this by searching for "toyos" in scene.scn.


I'm not sure if this is a cause for the crash, but it's something that needs to be addressed in any case - paths should be relative to the project's resource bundle, not hardcoded absolute paths.


Unfortunately I have not installed OS X 10.12 so can't test on that platform.

Same. I can't run it in simulator, Mac or device.

anyone got this working?

Accepted Answer

Quick update: I installed the new beta of iOS 10 on my iPad Mini 2 and without recompiling or reinstalling it worked. There must have been a bug that prevented the sample to work on some configurations.


I am installing the new Xcode too, and will see if it works on the simulator too.

Final update: I installed macOS Sierra on a MacBook Air and added Xcode 8 beta 2. The mac target runs flawlessly, and as I said before on a device it runs as well. The only place that still gives me the error is when I try to run it in the simulator, regardless of what I choose (iPads, iPhones).


As far as I'm concerned I'm comfortable with running Badger on Sierra or an iOS 10 device.

Badger code sample does not run on iOS 10 when compiled on El Capitan?
 
 
Q