-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App terminate on iOS 11 when enter to background #11623
Comments
All these crash issues on iOS 11 prevent the stable 2.1 from be readying for publishing apps. |
I think this should be fixed on 2.1 also. |
@alexzheng https://stackoverflow.com/questions/45319215/ios-11-beta-4-presentrenderbuffer-crash |
not work. |
Can you show the output of 'bt full'? |
nothing more for bt full (lldb) bt full |
Cann't you reproduce it? |
Try this patch, it's not crashing for me anymore with it: |
Still crash. void AudioDriverIphone::finish() {
}; void OSIPhone::finalize() {
}; |
My device is a iPhone 7 plus. |
That's weird, code you posted seems fine, did it crash on the same place as before? And can you add a |
the same place. iphone_finish
|
Seems to be a different crash actually, it's crashing on _thread_func now.
And this on
|
this stop the crash,but freezes the app when enter to foreground and then crash |
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:
The problem is why the app gets terminated in the first place after the home button press.
I also tested the same app on an iOS 10 simulator and it wasn't terminated, and therefore, it stayed in its background state.
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. |
and where does it crashes after entering foreground?
I think iOS11 is just ignoring |
I tested
With
Therefore, I do not think that iOS 11 ignores this setting. |
I see, maybe our |
It does not stop crash, it just delay the crash after enter to background. AudioDriverIphone::finish
|
It seems the code in the patch has free the same memory multiple times. |
Try this, remove the |
I have tried it hours 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. |
Maybe some memory has already been corrupted when enter to background cause the application I’llterminate get called. |
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. |
TEMPORARY FIX No code changes are needed to make this work on compile. Run the following (tested on 2.1 & 2.1.4-stable branches): The important part is pointing the iPhoneSDK to the symlinked location instead.
Now when the app is suspended/backgrounded, it will not crash and resumes as expected :) |
Yes, amazing. |
@fuzzeemic, Thanks very much, you are the hero! It's really amazing. |
So should we change the default |
@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) |
Yes, it works now! Thank you @fuzzeemic !!! |
@marcelofg55 @BastiaanOlij Thoughts on bumping the |
I'm trying to compile ios template on ubuntu.
now I got error below.
I found somethings are changed from 10.x to 11 |
compiling problem is gone after updating clang to 4.0 (rc1) :) |
@fuzzeemic That's promising. By the way, is it possible to include list of architecture to build for at the same time in |
Is this still valid in the current master branch? How can we fix this properly? |
@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 |
- admob module add, remove firebase admob
@akien-mga and others, what is the status of this? |
I can't reproduce it with iPhone 4s with 9.3.5 (can't get ios 11) |
According to @BastiaanOlij it seems to work fine in 3.1 beta 2. I guess this issue might be specific to 2.1.x now. |
Is it important to fix this for 2.1, or the issue can be closed? |
It would still be important to fix for If anyone uses 2.1.6+ and experiences a similar crash on iOS, please open a new issue. |
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:
Steps to reproduce:
Link to minimal example project:
The text was updated successfully, but these errors were encountered: