Why are there no dynamic framework targets for React Native?
See original GitHub issueDescription
React Native has only static library targets. Any reason why there are no dynamic framework targets as well?
I understand why this was done from the start, as RN supported iOS 7 (and possibly below) at some point, but since the project now has a deployment target of iOS 8, there really is nothing to prevent dynamic frameworks on the surface. Any underlying technical issues in supporting it?
Adding dynamic framework targets will finally allow stopping the HEADER_SEARCH_PATHS
hell of sub-projects. Working with Swift projects will also be much simpler.
Solution
There are two solutions I can think of; add dynamic frameworks targets directly and include all source files there, all headers in the headers phase. Or, create a dynamic framework wrapper that links with the static libs, but still exposes the headers in a headers phase. The former is more elegant, but the latter can be a little bit less work to maintain.
Additional Information
- React Native version: Latest git source as of 2016-12-7.
- Platform: iOS
- Operating System: MacOS/Xcode
Issue Analytics
- State:
- Created 7 years ago
- Reactions:20
- Comments:13 (9 by maintainers)
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we’re automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
@kanekin Yes, it is possible. You create a dynamic framework target, link the static framework, and add
-ObjC -all_load
to yourOTHER_LDFLAGS
(other linker flags). As for exposing the headers, you can either manually add the static framework headers to the dynamic framework’s Copy Headers Phase, or write a script that exports them as expected. The former is seemingly easier, but becomes maintenance hell if your static framework is actively changing (as is the case with React Native).