godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.82k stars 21.14k forks source link

App terminate on iOS 11 when enter to background #11623

Closed alexzheng closed 4 years ago

alexzheng commented 7 years ago

Operating system or device, Godot version, GPU Model and driver (if graphics related): godot 2.1 iOS 11.0.1

Issue description:

Run any Godot app on a device of iOS 11, then press home button to enter to background, it will crash This only happens on iOS 11, before iOS 11 it work well.

here is the backtrace:

iphone_finish
WARNING: cleanup: ObjectDB Instances still exist!
   At: core/object.cpp:1845.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.
   At: core/os/memory.cpp:59.
(lldb) bt
* thread #13, name = 'AURemoteIO::IOThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00000001027756d4 godot_opt.iphone`AudioDriverIphone::output_callback(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 304
    frame #1: 0x000000018a71d2a8 AudioToolbox`AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 176
    frame #2: 0x000000018a4a8e00 AudioToolbox`AUInputFormatConverter2::InputProc(OpaqueAudioConverter*, unsigned int*, AudioBufferList*, AudioStreamPacketDescription**, void*) + 220
    frame #3: 0x000000018a40fdd4 AudioToolbox`AudioConverterChain::CallInputProc(unsigned int) + 596
    frame #4: 0x000000018a40fa64 AudioToolbox`AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 128
    frame #5: 0x000000018a3ebe38 AudioToolbox`BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 192
    frame #6: 0x000000018a375538 AudioToolbox`CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
    frame #7: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #8: 0x000000018a3ebe08 AudioToolbox`BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 144
    frame #9: 0x000000018a6506f8 AudioToolbox`Resampler2Wrapper::RenderOutput(CABufferList*, unsigned int, unsigned int&) + 192
    frame #10: 0x000000018a412a7c AudioToolbox`SampleRateConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 48
    frame #11: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #12: 0x000000018a40f65c AudioToolbox`AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
    frame #13: 0x000000018a3ebcc8 AudioToolbox`BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 800
    frame #14: 0x000000018a5fec98 AudioToolbox`AudioConverterFillComplexBuffer + 1048
    frame #15: 0x000000018a4a864c AudioToolbox`AUConverterBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 640
    frame #16: 0x000000018a38d07c AudioToolbox`AURemoteIO::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 104
    frame #17: 0x000000018a722a20 AudioToolbox`AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, AUOutputElement*, unsigned int, AudioBufferList&) + 172
    frame #18: 0x000000018a7221ac AudioToolbox`AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 948
    frame #19: 0x000000018a38cd28 AudioToolbox`AURemoteIO::PerformIO(unsigned int, unsigned int, unsigned int, AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioBufferList*, int&) + 756
    frame #20: 0x000000018a38e1a0 AudioToolbox`AURIOCallbackReceiver_PerformIO + 356
    frame #21: 0x000000018a520018 AudioToolbox`_XPerformIO + 104
    frame #22: 0x000000018a70a5ec AudioToolbox`mshMIGPerform + 232
    frame #23: 0x000000018a70a804 AudioToolbox`MSHMIGDispatchMessage + 36
    frame #24: 0x000000018a38d4c0 AudioToolbox`AURemoteIO::IOThread::Run() + 288
    frame #25: 0x000000018a391a40 AudioToolbox`AURemoteIO::IOThread::Entry(void*) + 160
    frame #26: 0x000000018a712630 AudioToolbox`CAPThread::Entry(CAPThread*) + 84
    frame #27: 0x000000018658432c libsystem_pthread.dylib`_pthread_body + 308
    frame #28: 0x00000001865841f8 libsystem_pthread.dylib`_pthread_start + 312
    frame #29: 0x0000000186582c38 libsystem_pthread.dylib`thread_start + 4
(lldb) 

Steps to reproduce:

Link to minimal example project:

alexzheng commented 7 years ago

All these crash issues on iOS 11 prevent the stable 2.1 from be readying for publishing apps.

volzhs commented 7 years ago

I think this should be fixed on 2.1 also.

volzhs commented 7 years ago

@alexzheng https://stackoverflow.com/questions/45319215/ios-11-beta-4-presentrenderbuffer-crash Does this workaround work for you? I don't have a clue what actual problem is, but I found this issue exists with other engine or framework. https://issuetracker.unity3d.com/issues/ios-opengles-opengles2-and-opengles3-builds-crashes-on-ios11-in-gleshelper-dot-mm http://discuss.cocos2d-x.org/t/3-15-1-crash-in-ios-11-beta-4/38168/9

alexzheng commented 7 years ago

not work.

marcelofg55 commented 7 years ago

Can you show the output of 'bt full'?

alexzheng commented 7 years ago

nothing more for bt full

(lldb) bt full error: _regexp-bt

alexzheng commented 7 years ago

Cann't you reproduce it? It crash for each simple demo project on iOS 11 device.

marcelofg55 commented 7 years ago

Try this patch, it's not crashing for me anymore with it: iphone_crashfix.patch.zip

alexzheng commented 7 years ago

Still crash. Am I miss some code?

void AudioDriverIphone::finish() { AURenderCallbackStruct callback; zeromem(&callback, sizeof(AURenderCallbackStruct)); OSStatus result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)); if (result != noErr) { ERR_PRINT("AudioUnitSetProperty failed"); }

memdelete_arr(samples_in);

};

void OSIPhone::finalize() {

audio_driver->finish();

if (main_loop) // should not happen?
    memdelete(main_loop);

visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);

physics_server->finish();
memdelete(physics_server);

physics_2d_server->finish();
memdelete(physics_2d_server);

spatial_sound_server->finish();
memdelete(spatial_sound_server);

memdelete(input);

spatial_sound_2d_server->finish();
memdelete(spatial_sound_2d_server);

};

alexzheng commented 7 years ago

My device is a iPhone 7 plus.

marcelofg55 commented 7 years ago

That's weird, code you posted seems fine, did it crash on the same place as before? And can you add a print_line("AudioDriverIphone::finish"); on AudioDriverIphone::finish() to see if it's getting called. I tested it on an iPhone 6 with iOS 11.0.1. I don't have a 7 plus one sadly :(.

alexzheng commented 7 years ago

the same place. output:

iphone_finish AudioDriverIphone::finish WARNING: cleanup: ObjectDB Instances still exist!  At: core/object.cpp:1845. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59. (lldb) bt

marcelofg55 commented 7 years ago

Seems to be a different crash actually, it's crashing on _thread_func now. Try this on platform/iphone/os_iphone.cpp:

diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 10dc296..1754496 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -368,9 +368,14 @@ void OSIPhone::delete_main_loop() {

 void OSIPhone::finalize() {

+       audio_driver->finish();
+
        if (main_loop) // should not happen?
                memdelete(main_loop);

+       audio_server->finish();
+       memdelete(audio_server);
+
        visual_server->finish();
        memdelete(visual_server);
        memdelete(rasterizer);

And this on servers/audio/audio_server_sw.cpp:

diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp
index 28da2c1..841552d 100644
--- a/servers/audio/audio_server_sw.cpp
+++ b/servers/audio/audio_server_sw.cpp
@@ -726,7 +726,8 @@ void AudioServerSW::_thread_func(void *self) {

        while (!as->exit_update_thread) {
                as->_update_streams(true);
-               OS::get_singleton()->delay_usec(5000);
+               if (OS::get_singleton())
+                       OS::get_singleton()->delay_usec(5000);
        }
 }
alexzheng commented 7 years ago

this stop the crash,but freezes the app when enter to foreground and then crash

egorh1 commented 7 years ago

I had the same crash as @alexzheng described in his initial post. However, I think that the problem is not the crash after iphone_finish gets called:

iphone_finish �[1;33mWARNING: cleanup: �[0m�[1mObjectDB Instances still exist! �[0;33m At: core/object.cpp:1845.�[0m �[1;31mERROR: free_static: �[0m�[1mCondition ' !MemoryPoolStatic::get_singleton() ' is true. �[0;31m At: core/os/memory.cpp:59.�[0m �[1;31mERROR: free_static: �[0m�[1mCondition ' !MemoryPoolStatic::get_singleton() ' is true. �[0;31m At: core/os/memory.cpp:59.�[0m �[1;31mERROR: free_static: �[0m�[1mCondition ' !MemoryPoolStatic::get_singleton() ' is true. �[0;31m At: core/os/memory.cpp:59.�[0m

The problem is why the app gets terminated in the first place after the home button press.

... console: * will resign active console: **** stop animation! console: * did enter background (something happens here that causes iOS 11 to terminate the app) console: ***** will terminate console: iphone_finish ...

I also tested the same app on an iOS 10 simulator and it wasn't terminated, and therefore, it stayed in its background state.

... console: * will resign active console: **** stop animation! console: * did enter background ...

I also tried to set the "Application does not run in background (UIApplicationExitsOnSuspend)" Boolean to "NO" in the project's info.plist but it did not help.

marcelofg55 commented 7 years ago

this stop the crash,but freezes the app when enter to foreground and then crash

and where does it crashes after entering foreground?

I also tried to set the "Application does not run in background (UIApplicationExitsOnSuspend)" Boolean to "NO" in the project's info.plist but it did not help.

I think iOS11 is just ignoring UIApplicationExitsOnSuspend and quitting the application anyways. Maybe UIBackgroundModes could help.

egorh1 commented 7 years ago

I tested UIApplicationExitsOnSuspend with a demo Unity project on iOS 11 device and it behaves appropriately. With NO:

-> applicationWillResignActive() -> applicationDidEnterBackground()

With YES:

-> applicationWillResignActive() -> applicationDidEnterBackground() -> applicationWillTerminate()

Therefore, I do not think that iOS 11 ignores this setting. UIBackgroundModes are for background services, in our case the app should just stay in its background state without any further code execution after applicationDidEnterBackground.

marcelofg55 commented 7 years ago

I see, maybe our applicationDidEnterBackground is the problem.

alexzheng commented 7 years ago

It does not stop crash, it just delay the crash after enter to background. And the AudioDriverIphone::finish called twice.

AudioDriverIphone::finish AudioDriverIphone::finish (lldb) bt

alexzheng commented 7 years ago

It seems the code in the patch has free the same memory multiple times.

marcelofg55 commented 7 years ago

It does not stop crash, it just delay the crash after enter to background. And the AudioDriverIphone::finish called twice.

Try this, remove the audio_driver->finish(); line at OSIPhone::finalize().

alexzheng commented 7 years ago

I have tried it hours ago.

alexzheng commented 7 years ago

The crash is triggered in this method:

Because when enter to background on iOS 10, this callback will not called, but on iOS 11 it is called. You can mimic to call this method on iOS 10 to debug it.

alexzheng commented 7 years ago

Maybe some memory has already been corrupted when enter to background cause the application I’llterminate get called.

BastiaanOlij commented 7 years ago

I haven't dived far enough into things but I think the problem with the iOS setup is that Apple has changed the way this worked several times over time and some of the Godot iOS code seems to be from an earlier time.

Originally until the iPhone 4 (I think it was) came out an application that goes into the background would be terminated as multitasking wasn't supported. Then when you went back to the application it would reload and you as a developer where tasks to bring it back into the state it was before it closed.

When multitasking got added they added new methods that signal your application that it would go into the background but wouldn't terminate your application. Many applications never implemented those keeping the application running at full steam in a background thread waisting your battery in no time so Steve Jobs could tell us "see, this is why we were against multitasking on a phone".

My guess is that they've probably introduced a new keyword in the plist that tells the OS whether to terminate an app when it goes into the background or whether it can keep a background thread alive. Dunne know, guessing here.

Be as it may, I've noticed cleanup isn't Godots strong point here. It's probably worth having a closer look at all the notifications that main application delegate gets and moving things around into the right place so things that need to get paused get paused and things that need to terminate get properly stopped and deallocated.

BastiaanOlij commented 7 years ago

Btw, @marcelofg55,

it makes sense audio server gets destructed twice. In your changes you are cleaning it up in iPhone finish, but it is already being cleaned up in Main::cleanup()

OSIPhone::finalize should only clean up objects that were created in OSIPhone::initialize

What I do find interesting is that the audio server gets destructed before finalize gets called (it also gets called from Main::cleanup), so there might be an issue as well as the audio driver gets destructed in finalize and may call back into the audio server which by this point no longer exists.

@reduz is the audio server meant to clean up any drivers automatically or should we move the cleanup code: https://github.com/godotengine/godot/blob/master/main/main.cpp#L1765 Till after finalize gets called here: https://github.com/godotengine/godot/blob/master/main/main.cpp#L1775

?

marcelofg55 commented 7 years ago

@BastiaanOlij You're thinking about master but this is for 2.1, on 2.1 Main::cleanup there is no audio_server->finish(), all the OS::finalize() of each OS call the audio_server->finish(). The only one that missed this call is the iPhone code.

marcelofg55 commented 7 years ago

I've re-checked my changes and I think I found the issue, the spatial_sound_server/spatial_sound_2d_server must be finished before finishing the audio_server. I've re-tested a few times and didn't get any crash using a iPhone 6 with iOS 11.0.1. Changes are this branch: https://github.com/marcelofg55/godot/tree/iphone_crashfix

BastiaanOlij commented 7 years ago

@marcelofg55 my bad, yes I was purely looking at master... Though reading that, good change that on master this will cause issues as well due to the audio server being finished too early. I can't test right now but worth having a look at.

marcelofg55 commented 7 years ago

I think master shouldn't have this problem as that part got re-written but yeah we should test it just in case, I'll give it a try out tomorrow, if you can test it out too that would be great :).

BastiaanOlij commented 7 years ago

Owh I still have plenty of instability and crashes on iOS on master so there is definitely more to figure out. But my focus is currently on other things so I need to find time :)

alexzheng commented 7 years ago

@marcelofg55 https://github.com/marcelofg55/godot/tree/iphone_crashfix It still terminate when enter to background.

2017-10-03 12:05:34.685824+0800 godot_opt.iphone[5898:2645519] refreshPreferences: HangTracerEnabled: 0 2017-10-03 12:05:34.685898+0800 godot_opt.iphone[5898:2645519] refreshPreferences: HangTracerDuration: 500 2017-10-03 12:05:34.685929+0800 godot_opt.iphone[5898:2645519] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0 did become active 2017-10-03 12:05:34.918026+0800 godot_opt.iphone[5898:2646133] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length 2017-10-03 12:05:35.789756+0800 godot_opt.iphone[5898:2645933] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. WARNING: _png_warn_function: iCCP: known incorrect sRGB profile  At: drivers/png/image_loader_png.cpp:66. ERROR: get_node: Node not found: shield  At: scene/main/node.cpp:907. will resign active **** stop animation! did enter background will terminate iphone_finish ERROR: action_release: Condition ' !custom_action_press.has(p_action) ' is true.  At: main/input_default.cpp:483. ERROR: add_child: Parent node is busy setting up children, add_node() failed. Consider using call_deferred("add_child", child) instead.  At: scene/main/node.cpp:719. killed_ememy_scores [100, 0, 0, 0] ERROR: add_child: Parent node is busy setting up children, add_node() failed. Consider using call_deferred("add_child", child) instead.  At: scene/main/node.cpp:719. ERROR: ~List: Condition ' _first != null ' is true.  At: core/self_list.h:80. ERROR: ~List: Condition ' _first != null ' is true.  At: core/self_list.h:80. WARNING: cleanup: ObjectDB Instances still exist!  At: core/object.cpp:1845. ERROR: clear: Resources Still in use at Exit!  At: core/resource.cpp:378. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59. ERROR: free_static: Condition ' !MemoryPoolStatic::get_singleton() ' is true.  At: core/os/memory.cpp:59.

alexzheng commented 7 years ago

I totally agree with @hjegor

The problem is why the app gets terminated in the first place after the home button press.

alexzheng commented 7 years ago

The code change fix the crash when application will terminate, but the issue cause the termination when enter to background still exist.

egorh1 commented 7 years ago

Could it be a scons build problem? Because I removed the whole Godot part and only left the iOS specific stuff (app_delegate.mm, gl_view.mm) and it still gets terminated after the home button press...

Also, I receive the following error while I am trying to run the x86 build on my iOS11 simulator: dyld: dyld_sim is not compatible with the loaded process, likely due to architecture mismatch

alexzheng commented 7 years ago

even replace gl_view with a UIView still cause termination. This issue and #11628 make the stable 2.1 branch impossible for iOS products. Could any contributor proficient at iOS check these issues?

fuzzeemic commented 7 years ago

TEMPORARY FIX The solution in this forum post actually works for Godot as well. https://forums.adobe.com/thread/2387025

No code changes are needed to make this work on compile.

Run the following (tested on 2.1 & 2.1.4-stable branches): scons p=iphone -j 4 target=release tools=no arch=arm64 bits=64 IPHONESDK="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/"

The important part is pointing the iPhoneSDK to the symlinked location instead.

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/

Now when the app is suspended/backgrounded, it will not crash and resumes as expected :)

alexzheng commented 7 years ago

Yes, amazing. It's fixed now!

alexzheng commented 7 years ago

@fuzzeemic, Thanks very much, you are the hero!

It's really amazing. All the orientation issues are also fixed by this.

volzhs commented 7 years ago

image

akien-mga commented 7 years ago

So should we change the default IPHONESDK value, or will that break templates for iOS 10?

fuzzeemic commented 7 years ago

@akien-mga I think it's a safe change to make as it fixes most peoples current problems with the latest xcode and you can always override it on the command line back to whatever you want for older builds. (But I am only new here, so not sure on peoples workflow yet)

egorh1 commented 7 years ago

Yes, it works now!

Thank you @fuzzeemic !!!

akien-mga commented 7 years ago

@marcelofg55 @BastiaanOlij Thoughts on bumping the IPHONESDK value?

alexzheng commented 7 years ago

I think these two headache issues have also been fixed by this magic. At least I have tested on some iOS 11 and iOS 10 devices.

11628

11547

volzhs commented 7 years ago

I'm trying to compile ios template on ubuntu.

now I got error below.

$ scons -j 1 platform=iphone arch=arm64 IPHONESDK="/mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk" IPHONEPATH="/mnt/2TB/Development/iostoolchain" ios_triple="arm-apple-darwin11-"
scons: done reading SConscript files.
scons: Building targets ...
[  5%] Compiling ==> platform/iphone/gl_view.mm
In file included from platform/iphone/gl_view.mm:30:
In file included from platform/iphone/gl_view.h:31:
In file included from /mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:22:
In file included from /mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVAnimation.h:11:
In file included from /mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]') [17]
 - (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
                                                 ^
/mnt/2TB/Development/iPhoneSDK/iPhoneOS11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]') [17]
 - (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
                              ^
2 errors generated.
scons: *** [platform/iphone/gl_view.iphone.opt.debug.arm64.o] Error 1
scons: building terminated because of errors.

I found somethings are changed from 10.x to 11 http://codeworkshop.net/objc-diff/sdkdiffs/ios/11.0/Foundation.html how can I fix it? nobody suffers this issue?

volzhs commented 7 years ago

compiling problem is gone after updating clang to 4.0 (rc1) :)

haxpor commented 6 years ago

@fuzzeemic That's promising. By the way, is it possible to include list of architecture to build for at the same time in scons i.e. scons p=iphone -j 4 target=release tools=no bits=64 arch=arm64,armv7 ? So we could save time to just execute command for one time and have fat binary for both architecture at the end? cc: @akien-mga

akien-mga commented 6 years ago

Is this still valid in the current master branch? How can we fix this properly?

haxpor commented 6 years ago

@akien-mga I have an idea as follows assumed that machine that proceeds with this should be macOS. Anyway can we build iOS build with Windows or Linux anyway?

PS. As well we could force changing the active SDK path via sudo xcode-select -s /Volumes/Slave/Applications/Xcode8/Xcode.app/Contents/Developer but it needs administrator permission. Just in case, if we ever need this to do any customized stuff.