[Bug]:(IOS crash) NWPathMonitor Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
Platform
Ios +15
Plugin
connectivity_plus
Version
4.0.0
Flutter SDK
3.10.5
Steps to reproduce
Hi ,
when run the app on real device on release run I got iOS crash as screenshot shows :
Code Sample
No response
Logs
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
Flutter Doctor
[!] Flutter (Channel stable, 3.10.5, on macOS 14.0 23A5286g darwin-x64, locale en-EG)
! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.18.4/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/hesham/flutter. Consider adding /Users/hesham/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.80.0)
[✓] Connected device (2 available)
[✓] Network resources
Checklist before submitting a bug
- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I'm using the latest version of the plugin
- [X] All dependencies are up to date with
flutter pub upgrade - [X] I did a
flutter clean - [X] I tried running the example project
I also got the same error
same error
Same error but build runs perfectly on ios 17 beta 3
Its strange that no one has posted solution to this problem! Its occuring in iOS 16.5.1 as well Xcode 15 Beta. App works fine in old iOS and also in iOS 17 on simulator but doesn't work in iOS 16.5.1.
Just upgraded iOS to 16.6 now and still no luck. Same error!
I'm getting this same bug on iOS when I include the amplify_api package since it pulls in the connectivity_plus package.
Same error
I'm getting this same bug on iOS when I include the amplify_api package since it pulls in the connectivity_plus package.
Ok, just got to the temporary solution for this, i'll post the things i did to avoid this error.
Changed build Targets in pod and runner to 12.0 In Xcode, Runner -> Edit Scheme -> Removed all debug and diagnostics extras that could overload the memory i.e. In options i unchecked Debug XPC services used by app Enable user interface debugging Enable backtrace recroding Made sure that nothing is selected in diagnostics as well. While xcode 15.3 is installed, i have xcode 14.3.1 side by side as well, executed applitication on xcode 14.3.1 and it ran without any issue. I am not saying that it'll resolve the issue for you but it did for me. I am able to run app without any issue now
Thanks @madilsharief, you figured it out. The issue is XCode 15 beta 4. It works fine with XCode 14.3.1. That's all I changed and it worked right away:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
But heading out for vacation so I don't have time to get a minimal POC over to the XCode team to fix this!
Are there any updates on this?
I'm still able to reproduce in Xcode 15 beta 7 (released August 22nd) when running on iOS devices that are on OS version 16.6. Confirmed the issue is due to the connectivity_plus dependency and still reproduces on the latest version of connectivity_plus (4.0.2)
Haven't tested on flutter myself, but this looks like a problem related to XCode 15 removing support for iOS < 12. So a simple post_install script on the Podfile solved the issue for me. I'll post it here so maybe it can help someone else too:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
I got the same error anyone find the solution?
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0 config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end
Thank you, this works for me.
It works for me, just change the "Minimum Deployments" to "12.0" or up.
@sareth5555 note that manually changing the deployment target of a Pod will be reset on each pod install.
I would ask someone among people with this problem to validate the fix for the plugin. To do so, add the plugin the following way:
connectivity_plus:
git:
url: https://github.com/fluttercommunity/plus_plugins.git
path: packages/connectivity_plus/connectivity_plus
ref: cf7d93fbfc76830acf2db755543cf4235a49df60
UPD (Oct 3 2023): Because the PR with the fix is already merged updated the snippet to point to exact commit with the fix on main branch. Till the new version of connectivity_plus released this week, it is advised to use the version from the snippet.
Haven't tested on flutter myself, but this looks like a problem related to XCode 15 removing support for iOS < 12. So a simple post_install script on the Podfile solved the issue for me. I'll post it here so maybe it can help someone else too:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0 config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end end
Thank you, it's worked for me.
This is not changing the deployment target in any Pod. You just change it in the main project. So there is no any effect if you do pod install.
On Fri, 22 Sep 2023 at 3:40 PM Enrico Zannini @.***> wrote:
@sareth5555 https://github.com/sareth5555 note that manually changing the deployment target of a Pod will be reset on each pod install.
— Reply to this email directly, view it on GitHub https://github.com/fluttercommunity/plus_plugins/issues/1955#issuecomment-1731040420, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIA5X2XVTPQH3VN22JPQCP3X3VFH3ANCNFSM6AAAAAA2DV7KEY . You are receiving this because you were mentioned.Message ID: @.***>
@vankhanh0911 @sareth5555 I would encourage you to try the update for connectivity_plus (currently lives in #2169), which I mentioned here: https://github.com/fluttercommunity/plus_plugins/issues/1955#issuecomment-1741748647
I would like to understand that changes indeed fixed the problem and I can merge and release an update for the plugin.
Info for those arriving to this issue when Googling and still having this issue:
The issue is confirmed when building for iOS <17, active issue is here https://github.com/fluttercommunity/plus_plugins/issues/2276
I have the some problem after updating Mac and iPhone OS. Is going to be a new version soon that should fix the problem?