plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

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

Open heshesh2010 opened this issue 3 years ago • 24 comments

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

  • [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

heshesh2010 avatar Jul 09 '23 19:07 heshesh2010

I also got the same error

20156284 avatar Jul 14 '23 07:07 20156284

same error

lokiwiki avatar Jul 15 '23 09:07 lokiwiki

Same error but build runs perfectly on ios 17 beta 3

Devashan avatar Jul 24 '23 09:07 Devashan

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!

madilsharief avatar Jul 25 '23 08:07 madilsharief

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

assemblethis avatar Jul 28 '23 03:07 assemblethis

Same error

ryan-deng98 avatar Jul 28 '23 06:07 ryan-deng98

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

madilsharief avatar Jul 28 '23 07:07 madilsharief

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!

assemblethis avatar Jul 28 '23 21:07 assemblethis

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)

corey-sobel avatar Aug 24 '23 22:08 corey-sobel

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

Enricoza avatar Sep 19 '23 11:09 Enricoza

I got the same error anyone find the solution?

vinodlee avatar Sep 19 '23 12:09 vinodlee

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.

RicBau2610 avatar Sep 20 '23 12:09 RicBau2610

Screenshot 2023-09-22 at 3 34 58 PM

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

sareth5555 avatar Sep 22 '23 08:09 sareth5555

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

Enricoza avatar Sep 22 '23 08:09 Enricoza

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.

vbuberen avatar Sep 30 '23 11:09 vbuberen

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.

vankhanh0911 avatar Oct 02 '23 04:10 vankhanh0911

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: @.***>

sareth5555 avatar Oct 02 '23 04:10 sareth5555

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

vbuberen avatar Oct 02 '23 08:10 vbuberen

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

marianhlavac avatar Oct 19 '23 13:10 marianhlavac

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

burekas7 avatar Oct 19 '23 18:10 burekas7