segmentio / analytics-ios

The hassle-free way to integrate analytics into any iOS application.
https://segment.com/libraries/ios
MIT License
402 stars 334 forks source link

App crash on Analytics configuration #1041

Open vipul898989 opened 2 years ago

vipul898989 commented 2 years ago

When we configure Analytics application crash. here is the code for initialisation and that function where i got crash.

public func initAnalytics() {

    let configuration = AnalyticsConfiguration.init(writeKey: "...........")
    configuration.trackApplicationLifecycleEvents = true
    configuration.recordScreenViews = false
    configuration.trackPushNotifications = true

    configuration.use(SEGAppsFlyerIntegrationFactory())
    configuration.use(SEGFlurryIntegrationFactory.instance() as! SEGFlurryIntegrationFactory)
    configuration.use(SEGAmplitudeIntegrationFactory.instance())
    configuration.use(SEGMixpanelIntegrationFactory.instance())
    configuration.use(SEGFirebaseIntegrationFactory.instance())

    Analytics.debug(true)
    Analytics.setup(with: configuration) **// at this line i found crash**

}

Crash Details: *** -[NSKeyedUnarchiver validateAllowedClass:forKey:]: NSSecureCoding allowed classes list contains [NSObject class], which bypasses security by allowing any Objective-C class to be implicitly decoded. Consider reducing the scope of allowed classes during decoding by listing only the classes you expect to decode, or a more specific base class than NSObject. This will become an error in the future. Allowed class list: {( "'NSObject' (0x234a6de30) [/usr/lib]" )}

Hardware details: macOS Monterey 12.4 Xcode 13.4.1 iPhone Xs with iOS 15.5

Can someone help me solve this?