Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdjustSDK static framework doesn't include a module map and is unusable from Swift #361

Closed
jeffremer opened this issue Dec 4, 2018 · 6 comments

Comments

@jeffremer
Copy link

jeffremer commented Dec 4, 2018

In attempting to replace our Cocoapods installation of the AdjustSDK with the static framework available in the releases I ran into an issue attempting to use the SDK from Swift. Neither import Adjust nor import AdjustSDK work, so I took a look inside the framework and it is indeed missing a module map, rendering it unusable from Swift. The dynamic version of the framework does include a module map.

This is easily reproducible:

  1. Create a new Swift iOS project
  2. Drag the static framework into the link binary with libraries build phase
  3. Try to import Adjust or import AdjustSDK or importAdjustSdk from Swift
  4. Build and watch it fail

It's pretty easy to fix as well, by manually creating a Modules directory and the module map file in there…

AdjustSdk.framework > Modules > module.modulemap

framework module AdjustSdk {
  umbrella header "Adjust.h"

  export *
  module * { export * }
}

Of course, as a consumer of this SDK I'd have to do this manual step whenever I integrate a new version of it.

@uerceg
Copy link
Contributor

uerceg commented Dec 4, 2018

Hi @jeffremer and thanks for reporting this. We’ll take a look. Will keep you posted.

@uerceg uerceg added the support label Jan 25, 2019
@uerceg
Copy link
Contributor

uerceg commented Mar 18, 2019

Hi @jeffremer

And sorry for a bit delayed answer. I am checking this topic now and wondering is there a reason why are you choosing static over dynamic framework? Generated dynamic framework seems to have module map like you have defined it and should be usable from Swift right away.

Reason why we are still having static framework in place is rather historical - we still support iOS 6.0 and we need it for some non native platforms which still didn't manage to find a way to handle dynamic frameworks. But if your app is supporting iOS 8.0 and above, dynamic framework should be fine to use.

Looking forward to hear from you.

Cheers

@jeffremer
Copy link
Author

jeffremer commented Mar 18, 2019

Dynamic library loading can cause slower launch times compared to statically building an SDK like yours into the app binary, especially if the app links a lot of dynamic frameworks (like ours does at the moment). If the SDK is only used in one binary in the app and is required at launch I don't see much benefit in requiring that it be a dynamic framework.

@uerceg
Copy link
Contributor

uerceg commented Mar 18, 2019

Fair enough. I'm now currently looking into best way how to add Modules folder into static framework structure without doing it super manually. Will keep you posted.

@uerceg uerceg removed the support label Mar 20, 2019
@uerceg
Copy link
Contributor

uerceg commented Mar 21, 2019

Having in mind that static framework as target doesn't exist in Xcode, rather we use script to build it that way from static libraries and headers, I just took the road of editing script to manually create AdjustSdk.framework/Modules folder and place predefined module.modulemap file in it. Seems to be working fine with Swift app. Will be live with upcoming 4.17.2 release.

@uerceg uerceg mentioned this issue Mar 21, 2019
@uerceg
Copy link
Contributor

uerceg commented Mar 21, 2019

Should be solved with latest release. In case this issue still persists with it as well, please feel free to reopen it.

@uerceg uerceg closed this as completed Mar 21, 2019
uerceg added a commit that referenced this issue May 31, 2024
Feat: Add read only once device info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants