bielikb / xcframeworks

Demonstration of creating and integrating xcframeworks and their co-op with static libraries and Swift packages
MIT License
539 stars 46 forks source link

Add bitcode to XCFramework and not able to run the scrip for creating xcframework #4

Closed jeetkapadia closed 4 years ago

jeetkapadia commented 4 years ago

HI,

Have you tried adding bitcode support to xcframework. I was not able to do so and was facing the issue. Also, I was not able to run your script for creating xcframework. I copied that script and added the same in my project under the build phases tab in the run script section. I am facing the following error "Output dir was not set. try to run ./scripts/create_xcframeworks.sh Products". Can you help me with that?

bielikb commented 4 years ago

Hi @jeetkapadia,

  1. Enabling bitcode

adding bitcode in projects I'm working on was seamless, could you please share, what problems have you faced? Does setting these build settings causing any issues in your projects?

ENABLE_BITCODE=YES
BITCODE_GENERATION_MODE=bitcode
OTHER_C_FLAGS=-fembed-bitcode
  1. Also, I was not able to run your script for creating xcframework. I copied that script and added the same in my project under the build phases tab in the run script section. I am facing the following error "Output dir was not set. try to run ./scripts/create_xcframeworks.sh Products".

The script shouldn't be run as part of your Build Phases, but rather standalone. The script require you to provide 1 parameter -> the output directory, where the generated xcframeworks will be stored. The simplest solution is to run this script from the commandline. If you want to run it through the Xcode, please consider setting up Aggregate target in your project that will fire the script with specified output directory`

The script that I've added to this repository is here solely to showcase how to create xcframework from projects in this repository. Please make sure to adjust it the way, that it will fit your purpose. I can commit more generalised version of that script if that helps

Screenshot 2020-02-06 at 23 38 01
jeetkapadia commented 4 years ago

yes, that would be of much help if you can provide me the more generalized script so I can integrate in my project. Many Thanks.

bielikb commented 4 years ago

@jeetkapadia , together with my friend Alex Alter-Pesotskiy we created fastlane plugin that will allow you to generate the xcframework.

You can find more info about the plugin here. Please, give it a spin and let me know, if this resolves your issues. You no longer need to specify a custom Build Phase in your project.

Best, Boris

bielikb commented 4 years ago

@jeetkapadia Im closing this issue, but if you'll come across any issues, please follow up and create a new issue ;)