adjust / cordova_sdk

This is the Cordova SDK of
http://www.adjust.com
MIT License
37 stars 43 forks source link

iOS building problems #107

Closed giordanocardillo closed 4 years ago

giordanocardillo commented 4 years ago

Hello, we had iOS building problems using this plugin. I had to manually remove i386 and x86_64 platforms from AdjustSdk executable in order to get to compile.

Leaving here if someone needs:

lipo -o AdjustSdk.framework/AdjustSdk -remove i386 AdjustSdk.framework/AdjustSdk
lipo -o AdjustSdk.framework/AdjustSdk -remove x84_64 AdjustSdk.framework/AdjustSdk
uerceg commented 4 years ago

👋 @giordanocardillo

Thanks for your comment. iOS native library is fat library built with both, device and simulator architectures support. So in case someone doesn't need simulator architectures inside of the library, can strip them with lipo like you did above.

This is also nice way how to maybe automate things so that you don't need to do it on your own upon each update.

Will close the issue, but if there's any need to reopen/comment, feel free to.

Cheers

giordanocardillo commented 4 years ago

I did that using a post install plugin hook on this very plugin, I'll do a PR if you need to add this. The hook adds a shell script to the build process in order to remove archs based on the build target

uerceg commented 4 years ago

Nice. 👌 In theory if that script runs post installation of our plugin, in that case running app with that state of our plugin on iOS Simulators would not really be possible? Or would it?

giordanocardillo commented 4 years ago

I've to ask, I've made some tries with my cordova app:

Why are the framework executables different between the repos?

uerceg commented 4 years ago

Which framework archive did you take from https://github.com/adjust/ios_sdk/releases/tag/v4.21.3?

If you check AdjustSdkStatic.framework.zip (which is static library used in Cordova SDK) and unzip it, you'll see that library in there is also a bit over 10MB (AdjustSdk.framework/Versions/A/AdjustSdk).

giordanocardillo commented 4 years ago

I've taken the dynamic one

uerceg commented 4 years ago

That one is not used in Cordova plugin, but static one.

giordanocardillo commented 4 years ago

I'm trying with the static one to see if throws the same error, thank you.

EDIT Same error as the cordova_sdk one

giordanocardillo commented 4 years ago

Are there problems if I use the dynamic one in a cordova application? Since it's the only one that works for me

uerceg commented 4 years ago

I guess not really. It's not how we intended it to work in plugin itself, so it's pretty much altering the plugin implementation, but if it works well for you, all good.