apptentive / apptentive-kit-ios

ApptentiveKit SDK for iOS and iPadOS
https://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

applyApptentiveTheme() Fails Using CocoaPods #16

Closed jshier closed 2 years ago

jshier commented 2 years ago

Due to the use of Bundle.bundle, which is only valid for packages integrated through Swift Package Manager (in CocoaPods it returns the app path), ApptentiveKit crashes at launch. I suggest using the normal class Bundle loader to find the proper directory when not using SPM.

CaseyApptentive commented 2 years ago

Hi @jshier, thanks for reaching out. Taking a look at this with my team and will follow up shortly.

frankus commented 2 years ago

Hi @jshier, the extension in Bundle+Apptentive.swift should be defining the module static property for non-SwiftPM integrations.

Could you look at the directory structure of your app bundle and let us know where the ApptentiveKit.bundle is ending up? It should be in the Frameworks/ApptentiveKit.framework directory if you are using the use_frameworks! directive, and in the root of the app bundle if not.

jshier commented 2 years ago

Yes, I see that now. (I wondered how it was working.) In that case, when running in the simulator it's returning just the application path. Let me see if I can debug it.

jshier commented 2 years ago

I wasn't able to replicate this on another machine, so it may have been due to running Xcode in Rosetta due to other M1-incompatible dependencies. I'll close for now unless it pops up again.