Repository navigation
Targeting iOS 11 (Flutter default minimum) built with Xcode 15 crashes EXC_BAD_ACCESS when using the Networking framework #136060
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
Compile my add and try to run it on any iOS device with iOS less than 17
Expected results
Should still run on all devices
Actual results
The app will just close and not run. The version compiled on the previous Xcode runs on all iOS versions
Code sample
I can not sare my code on a public forum but here you see when doing a flutter run it compiles and sends the app to the device. But will not run and does not give any error
[ ] Executing commands in
'/tmp/11B6DEEF-BC32-4701-8E4A-2B4EC6C4D636/fruitstrap-lldb-prep-cmds-4781749bcc830a01bf3326c466d1d86cea0bc844'.
[ ] (lldb) platform select remote-'ios' --sysroot '/Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7
(16H81)/Symbols'
[ ] Platform: remote-ios
[ ] Connected: no
[ ] Sysroot: /Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7 (16H81)/Symbols
[ ] SDK Path: "/Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7 (16H81)/Symbols"
[ ] (lldb) target create "/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos/Runner.app"
[+4832 ms] Current executable set to '/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos/Runner.app' (arm64).
[ ] (lldb) script
fruitstrap_device_app="/private/var/containers/Bundle/Application/F29C2CCD-BFBC-49C1-8363-8B854E50BB53/Runner.app"
[ +109 ms] (lldb) script fruitstrap_connect_url="connect://127.0.0.1:64790"
[ ] (lldb) script fruitstrap_output_path=""
[ ] (lldb) script fruitstrap_error_path=""
[ ] (lldb) target modules search-paths add /usr "/Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7
(16H81)/Symbols/usr" /System "/Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7 (16H81)/Symbols/System"
"/private/var/containers/Bundle/Application/F29C2CCD-BFBC-49C1-8363-8B854E50BB53"
"/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos"
"/var/containers/Bundle/Application/F29C2CCD-BFBC-49C1-8363-8B854E50BB53"
"/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos" /Developer "/Users/jacofourie/Library/Developer/Xcode/iOS
DeviceSupport/12.5.7 (16H81)/Symbols/Developer"
[ +26 ms] (lldb) command script import
"/tmp/11B6DEEF-BC32-4701-8E4A-2B4EC6C4D636/fruitstrap_4781749bcc830a01bf3326c466d1d86cea0bc844.py"
[ +2 ms] (lldb) command script add -f fruitstrap_4781749bcc830a01bf3326c466d1d86cea0bc844.connect_command connect
[ ] (lldb) command script add -s asynchronous -f fruitstrap_4781749bcc830a01bf3326c466d1d86cea0bc844.run_command run
[ ] (lldb) command script add -s asynchronous -f fruitstrap_4781749bcc830a01bf3326c466d1d86cea0bc844.autoexit_command autoexit
[ ] (lldb) command script add -s asynchronous -f fruitstrap_4781749bcc830a01bf3326c466d1d86cea0bc844.safequit_command safequit
[ ] (lldb) connect
[ +26 ms] (lldb) run
[ +300 ms] success
[ ] (lldb) safequit
[ +126 ms] Process 421 detached
[ +32 ms] Application launched on the device. Waiting for Dart VM Service url.
[ +721 ms] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
[+29288 ms] The Dart VM Service was not discovered after 30 seconds. This is taking much longer than expected...
[+85979 ms] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[+2892 ms] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
q
quit
^C% jacofourie@Jacos-Mac-Mini-M2 smh % flutter doctor -v
[✓] Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-ZA)
• Flutter version 3.13.6 on channel stable at /Users/jacofourie/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ead455963c (9 days ago), 2023-09-26 18:28:17 -0700
• Engine revision a794cf2681
• Dart version 3.1.3
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/jacofourie/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A240d
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.81.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (4 available)
• Jaco’s iPhone 14 (mobile) • 00008110-00110C9E1105401E • ios • iOS 17.0.3 21A360
• Developmet iphone 6 (mobile) • 4781749bcc830a01bf3326c466d1d86cea0bc844 • ios • iOS 12.5.7 16H81
• macOS (desktop) • macos • darwin-arm64 • macOS 14.0 23A344 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.149
[✓] Network resources
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
huycozy commentedon Oct 6, 2023
I run a minimal sample app on my device
iPhone 7, iOS 15.7.9but it can run normally. I'm usingXcode 15.0and macOS 14.0.Am I correct if you have this issue on iPhone 6, iOS 12.5.7? (from your flutter doctor output)
Please confirm if there is a similar issue on a newly created Flutter project. If it only occurs on your project, please share the complete output of
flutter run -v.JacoFourie commentedon Oct 6, 2023
If I create a new starter app it will run on the other iOS versions yes. But not my app. I have other devices that install the app via Testfligth that have the same issue. I have my own iPhone 14 with
iOS 17 that works fine and then a development iPhone 6 with iOS 12 that does not. Before I upgraded it worked all over. I can add you as a Testflight tester if you need to run the app to see what it does
Here is the flutter run - v output of the iPhone 6 in a file as it is too long to post here.
iPhone6.docx
JacoFourie commentedon Oct 6, 2023
And here is the output of the same app on the iPhone 14 with iOS 17 that works.
iPhone14.docx
mcagrigoktas commentedon Oct 7, 2023
I have the same problem on my devices before iOS 17.
huycozy commentedon Oct 9, 2023
Tail log
@JacoFourie Based on the tail log, it looks similar to #127656. Could you check if it's also your case? (@mcagrigoktas please also confirm this)
JacoFourie commentedon Oct 9, 2023
@huycozy, how do I check as there is no solution to the issue?
I did not change any code. The only thing that changed was I upgraded XCode.
I don't have time at the moment, but I will have to downgrade my XCode again
huycozy commentedon Oct 10, 2023
What I mean is to confirm you have the same situation there (similar issues should be centralized on one issue only).
The reporter of #127656 had updated iOS version instead but it might be related. Labeling this issue as a separate one for other's input.
[-]My flutter app wil only run on iOS 17 after I upgraded my Mac OS to Sonoma and Xcode to ver 15[/-][+]My flutter app will only run on iOS 17 after I upgraded my Mac OS to Sonoma and Xcode to ver 15[/+]49 remaining items
jmagman commentedon Jan 10, 2024
Flutter 3.16.6 now updates your project automatically to iOS 12, so there shouldn't be networking crashes.
nta-trongpq-2 commentedon Jan 12, 2024
@jmagman
If I would like manual update
Deployment targetwhat should I do?Just change
Minimum deploymentsinTarget->Runner->Generaltab is enough?Is need change:
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'andplatform :ios, '12.0'in Podfile?jmagman commentedon Jan 12, 2024
You should only need to update the Runner project minimum deployment, no changes needed in the Podfile. If you find you needed to change something else please let me know.
danallen88 commentedon Jan 19, 2024
We haven't upgraded from flutter 3.13.5 yet to the newest version, but I did have to do this in my Podfile, otherwise just changing it in:
IPHONEOS_DEPLOYMENT_TARGET = 12.0;in ios/Runner.xcodeproj/project.pbxprojby themselves did not make a difference for us.
jmagman commentedon Jan 19, 2024
@danallen88 interesting, I didn't see that in my testing, it seemed to be the deployment target of the app, not the frameworks, that mattered. Was the crash in connectivity_plus or somewhere else?
danallen88 commentedon Jan 19, 2024
Do you have any guidance on how to best determine this? I've tried running from Xcode as suggested above but had to change some settings to point Flutter at our custom entrypoint (we have multiple based on what flavor app we're building).
This is all I'm seeing:

jmagman commentedon Jan 19, 2024
That looks unrelated to this issue, and probably because your flavors aren't set up correctly, check your Configurations (see note in https://docs.flutter.dev/deployment/flavors#creating-flavors-in-ios). You can file a new issue and I can take a look.
I recommend updating to 3.16.6 to fix the connectivity crash, it will force all your pods to iOS 12 if they are at a lower minimum.
danallen88 commentedon Jan 19, 2024
I agree this is a different issue (it's my inability to run the app from Xcode the same way I would typically run it from Android Studio, probably because I'm missing something as you mentioned). I'm claiming that the app will actually crash immediately upon startup when I run our normal build through Android Studio, but I think I need to be able to run it from Xcode and not Android Studio in order to see the source of the crash if I understand correctly.
We were holding off upgrading flutter because of the breaking changes it introduces for us and hoping to resolve this in the meantime. But unless there is guidance on how to run a flavored app from Xcode directly, I'm not able to be much help in showing the root cause here.
jmagman commentedon Jan 19, 2024
@danallen88 is there a crash log for the device? Xcode > Window > Devices and Simulators > the crashing device > Open Recent Logs (the timestamps would match the crash)

danallen88 commentedon Jan 22, 2024
Unfortunately not. I appreciate you taking a look along with me! I'm thinking that if we can manage the upgrade to 3.16 and we still require that workaround, I will open a new issue. Thanks @jmagman!
github-actions commentedon Feb 5, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.