yonat / MultiSelectSegmentedControl

UISegmentedControl remake that supports selecting multiple segments, vertical stacking, combining text and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashing on iOS 12.2-12.4 when using OneSignal

ibuprofane opened this issue · comments

Description of the problem:
Hello, I've started seeing some crash reports in my app with the latest version of this control. The issue seems to be limited to iOS 12.2, 12.3, & 12.4; this does not occur on iOS 13. When I run a simulator using a pod of the latest version I get the following errors immediately on load:

dyld: lazy symbol binding failed: can't resolve symbol _$s7SwiftUI7BindingVMa in /Users/.../Library/Developer/CoreSimulator/Devices/7E3DD44E-.../data/Containers/Bundle/Application/72E31CE6-.../MyApp.app/Frameworks/MultiSelectSegmentedControl.framework/MultiSelectSegmentedControl because dependent dylib #1 could not be loaded

dyld: can't resolve symbol _$s7SwiftUI7BindingVMa in /Users/.../Library/Developer/CoreSimulator/Devices/7E3DD44E-.../data/Containers/Bundle/Application/72E31CE6.../MyApp.app/Frameworks/MultiSelectSegmentedControl.framework/MultiSelectSegmentedControl because dependent dylib #1 could not be loaded

The crash log shows "type metadata accessor for Binding + 52" as the break point.

Minimal project that reproduces the problem (so I'll be able to figure out how to fix it):
Tested with iOS Simulator using iPhone 8 on iOS 12.4

I can't reproduce the crash using the example project.
Are you using a different project? Which version of Xcode?

Hi Yonat,

I’m using this on my production project using the latest XCode 11.4. The issue is not a warning, but an immediate crash on load for iOS 12.2-12.4 users.

I tested the sample project using iOS 12.4 and it worked correctly. I also removed the pod from my project and it fixed the issue. The crash only happens with the pod included.

I think I found the source of the issue. My Podfile includes the OneSignal pod:
pod 'OneSignal', '>= 2.6.2', '< 3.0'

Adding this pod to your example causes the same crash. Not sure if there's a conflict with libraries or something...

Interesting. Maybe OneSignal bundles SwiftUI inside their framework.

A possible workaround is to use an older version of this pod:

pod 'MultiSelectSegmentedControl', '2.2.0'

Hello,
I'm having the same problem with OneSignal.
I worked around the problem by switching back to version 2.2.0.
Thanks for your work!