Skip to content

Targeting iOS 11 (Flutter default minimum) built with Xcode 15 crashes EXC_BAD_ACCESS when using the Networking framework #136060

Closed

Description

@JacoFourie

Is there an existing issue for this?

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!

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Oct 6, 2023
  2. huycozy commented on Oct 6, 2023

    @huycozy
    Member

    I run a minimal sample app on my device iPhone 7, iOS 15.7.9 but it can run normally. I'm using Xcode 15.0 and 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.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2023
  4. JacoFourie commented on Oct 6, 2023

    @JacoFourie
    Author

    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

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 6, 2023
  6. JacoFourie commented on Oct 6, 2023

    @JacoFourie
    Author

    And here is the output of the same app on the iPhone 14 with iOS 17 that works.
    iPhone14.docx

  7. mcagrigoktas commented on Oct 7, 2023

    @mcagrigoktas

    I have the same problem on my devices before iOS 17.

  8. huycozy commented on Oct 9, 2023

    @huycozy
    Member
    Tail log
    [ +129 ms] ------ Debug phase ------
    [        ] Starting debug of 4781749bcc830a01bf3326c466d1d86cea0bc844 (N61AP, iPhone 6 (GSM), iphoneos, arm64, 12.5.7, 16H81) a.k.a.
    'Developmet iphone 6' connected through USB...
    [+4205 ms] [  0%] Looking up developer disk image
    [  +32 ms] [ 95%] Developer disk image mounted successfully
    [  +21 ms] Symbol Path: /Users/jacofourie/Library/Developer/Xcode/iOS DeviceSupport/12.5.7 (16H81)/Symbols
    [ +409 ms] [100%] Connecting to remote debug server
    [        ] -------------------------
    [ +316 ms] (lldb) command source -s 0
    '/tmp/81751DCA-E9E1-4E70-9F0D-D032E2A49369/fruitstrap-lldb-prep-cmds-4781749bcc830a01bf3326c466d1d86cea0bc844'
    [        ] Executing commands in
    '/tmp/81751DCA-E9E1-4E70-9F0D-D032E2A49369/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"
    [+4948 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/2FA882A5-BBD7-4182-8E18-260A44577DE0/Runner.app"
    [  +55 ms] (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:64213"
    [        ] (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/2FA882A5-BBD7-4182-8E18-260A44577DE0"
    "/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos"
    "/var/containers/Bundle/Application/2FA882A5-BBD7-4182-8E18-260A44577DE0"
    "/Users/jacofourie/Desktop/FlutterProjects/smh/build/ios/iphoneos" /Developer "/Users/jacofourie/Library/Developer/Xcode/iOS
    DeviceSupport/12.5.7 (16H81)/Symbols/Developer"
    [  +36 ms] (lldb)     command script import
    "/tmp/81751DCA-E9E1-4E70-9F0D-D032E2A49369/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
    [  +27 ms] (lldb)     run
    [ +300 ms] success
    [        ] (lldb)     safequit
    [ +126 ms] Process 490 detached
    [  +47 ms] Application launched on the device. Waiting for Dart VM Service url.
    [ +730 ms] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
    [+29274 ms] The Dart VM Service was not discovered after 30 seconds. This is taking much longer than expected...

    @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)

  9. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 9, 2023
  10. JacoFourie commented on Oct 9, 2023

    @JacoFourie
    Author

    @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

  11. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 9, 2023
  12. huycozy commented on Oct 10, 2023

    @huycozy
    Member

    how do I check as there is no solution to the issue?

    What I mean is to confirm you have the same situation there (similar issues should be centralized on one issue only).

    The only thing that changed was I upgraded XCode.

    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.

  13. changed the title [-]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[/+] on Oct 10, 2023
  14. added
    platform-iosiOS applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Oct 10, 2023
  15. 49 remaining items

  16. jmagman commented on Jan 10, 2024

    @jmagman
    Member

    Flutter 3.16.6 now updates your project automatically to iOS 12, so there shouldn't be networking crashes.

  17. nta-trongpq-2 commented on Jan 12, 2024

    @nta-trongpq-2

    @jmagman
    If I would like manual update Deployment target what should I do?
    Just change Minimum deployments in Target ->Runner -> General tab is enough?
    Is need change: config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' and platform :ios, '12.0' in Podfile?

  18. jmagman commented on Jan 12, 2024

    @jmagman
    Member

    @jmagman If I would like manual update Deployment target what should I do? Just change Minimum deployments in Target ->Runner -> General tab is enough? Is need change: config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' and platform :ios, '12.0' in Podfile?

    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.

  19. danallen88 commented on Jan 19, 2024

    @danallen88

    @jmagman If I would like manual update Deployment target what should I do? Just change Minimum deployments in Target ->Runner -> General tab is enough? Is need change: config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' and platform :ios, '12.0' in Podfile?

    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.

    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:

    • ios/Flutter/AppFrameworkInfo.plist
    • every instance of IPHONEOS_DEPLOYMENT_TARGET = 12.0; in ios/Runner.xcodeproj/project.pbxproj

    by themselves did not make a difference for us.

  20. jmagman commented on Jan 19, 2024

    @jmagman
    Member

    @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?

  21. danallen88 commented on Jan 19, 2024

    @danallen88

    @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?

    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:
    Screenshot 2024-01-19 at 3 34 48 PM

  22. jmagman commented on Jan 19, 2024

    @jmagman
    Member

    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.

  23. danallen88 commented on Jan 19, 2024

    @danallen88

    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.

  24. jmagman commented on Jan 19, 2024

    @jmagman
    Member

    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.

    @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)
    Screenshot 2024-01-19 at 1 22 58 PM

  25. danallen88 commented on Jan 22, 2024

    @danallen88

    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!

  26. github-actions commented on Feb 5, 2024

    @github-actions

    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 -v and a minimal reproduction of the issue.

  27. locked as resolved and limited conversation to collaborators on Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work liste: OS-version specificAffects only some versions of the relevant operating systemplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions