Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Exception NSInvalidArgumentException caught in Braze method initWithApiKey:withAppboyOptions #263

Closed radutacatalin closed 3 years ago

radutacatalin commented 3 years ago

Report

[APPBOY] Exception NSInvalidArgumentException caught in Braze method initWithApiKey:withAppboyOptions:: +[ABKPersistentData configureForDataVersioning]: unrecognized selector sent to class 0x107773ab0

Describe your environment.

Info Value
Platform Name ios
Platform Version 14.1
SDK Version 3.29.1
Integration Method SPM
Xcode Version Xcode 12.1
Repro rate all the time (100%)

What did you do?

Integrate Braze through SPM

What did you expect to happen?

Normal start of Appboy shared instance

What happened instead?

Braze SDK doesn't create any sessions for the test user. Log: [APPBOY] Exception NSInvalidArgumentException caught in Braze method initWithApiKey:withAppboyOptions:: +[ABKPersistentData configureForDataVersioning]: unrecognized selector sent to class 0x107773ab0

Steps to reproduce

Follow the steps to add the SDK using SPM.

Code Snippet

Appboy.start(withApiKey: appKey, in: application, withLaunchOptions: launchOptions)

clausjoergensen commented 3 years ago

Why did you close the issue @radutacatalin ?

radutacatalin commented 3 years ago

This was caused by not adding the -ObjC linker flag. I was able to integrate the SDK successfully using SPM in a new framework where I could enable the -ObjC flag, and then importing it in the main project.