Skip to content
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

[Bug]:(IOS crash) NWPathMonitor Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) #1955

Closed
7 tasks done
heshesh2010 opened this issue Jul 9, 2023 · 24 comments · Fixed by #2169
Closed
7 tasks done

[Bug]:(IOS crash) NWPathMonitor Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) #1955

heshesh2010 opened this issue Jul 9, 2023 · 24 comments · Fixed by #2169
Labels
bug Something isn't working triage

Comments

@heshesh2010
Copy link

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 :

Screenshot 2023-07-09 at 10 47 12 PM

Screenshot 2023-07-09 at 10 47 20 PM

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

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@heshesh2010 heshesh2010 added bug Something isn't working triage labels Jul 9, 2023
@20156284
Copy link

I also got the same error

@lokiwiki
Copy link

same error

@Devashan
Copy link

Same error but build runs perfectly on ios 17 beta 3

@madilsharief
Copy link

madilsharief commented Jul 25, 2023

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!

@assemblethis
Copy link

I'm getting this same bug on iOS when I include the amplify_api package since it pulls in the connectivity_plus package.

@Ricardoi1
Copy link

Same error

@madilsharief
Copy link

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

@assemblethis
Copy link

assemblethis commented Jul 28, 2023

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!

@corey-sobel
Copy link

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)

@Enricoza
Copy link

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

@vinodlee
Copy link

I got the same error anyone find the solution?

@RicBau2610
Copy link

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.

@sareth5555
Copy link

Screenshot 2023-09-22 at 3 34 58 PM

It works for me, just change the "Minimum Deployments" to "12.0" or up.

@Enricoza
Copy link

@sareth5555 note that manually changing the deployment target of a Pod will be reset on each pod install.

@vbuberen
Copy link
Collaborator

vbuberen commented Sep 30, 2023

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.

@vankhanh0911
Copy link

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.

@sareth5555
Copy link

sareth5555 commented Oct 2, 2023 via email

@vbuberen
Copy link
Collaborator

vbuberen commented Oct 2, 2023

@vankhanh0911 @sareth5555 I would encourage you to try the update for connectivity_plus (currently lives in #2169), which I mentioned here: #1955 (comment)
I would like to understand that changes indeed fixed the problem and I can merge and release an update for the plugin.

@marianhlavac
Copy link

marianhlavac commented Oct 19, 2023

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 #2276

@burekas7
Copy link

burekas7 commented Oct 19, 2023

I have the some problem after updating Mac and iPhone OS.
Is going to be a new version soon that should fix the problem?

@nnguyenngoclan
Copy link

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

It worked for me too. Thanks!

@alistair-riskmemo
Copy link

I just updated connectivity_plus to 5.0.1, and it worked (I already had the min deployment target above 12, but that didn't work)

@Pon-Coding
Copy link

Pon-Coding commented Dec 12, 2023

The issue has been solved. I hope it can help you guys and prevent similar problems in the future.

✅ Link solution : https://stackoverflow.com/a/77643660/22005920

@anandnool
Copy link

anandnool commented Apr 8, 2024

I had done couple of things in xcode 15 it started works.I share the screenshot
1.Pod file -->comment out previouss code and created new post install which will update all pods to IOS 14.
2.In target-->build setting-->other linker flags-->added -id_classic
3.In target-->build settings-->search-->ENABLE_USER_SANDBOXING-->In Build options--> change user script sandboxing to 'No'
4.Check minimum deployment target >12-->I kept 14
5.Removed previous workspace from xcode.
6.Remove project.workspace from ios folder of your project
7.Remove podfile.lock
8.pod deintegrate
9.pod cache clean-all
10.pod install
11.open the new workspace in xcode
WhatsApp Image 2024-04-08 at 9 25 18 PM
WhatsApp Image 2024-04-08 at 9 25 18 PM (2)
WhatsApp Image 2024-04-09 at 7 58 22 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.