Apple bundle for framework fails to import
See original GitHub issueCheers,
I’m trying to use the examples i’ve found online to generate an ObjC framework which i can later include in an ObjC project and i keep getting this error: fatal error: 'ObjcFramework/SampleObjcClass.h' file not found #import <ObjcFramework/SampleObjcClass.h>
where ObjcFramework is the framework i’m generating with a BUCK file and SampleObjcClass is one of the exported headers
this is the buck file for the main app:
apple_resource(
name = 'BuckSampleAppResources',
files = glob(['*.png','*.storyboard']),
dirs = [],
)
apple_bundle(
name = 'BuckSample',
binary = ':BuckSampleBinary',
extension = 'app',
info_plist = 'Info.plist',
deps = [':BuckSampleAppResources'],
)
apple_binary(
name = 'BuckSampleBinary',
preprocessor_flags = ['-fobjc-arc'],
headers = glob([
'*.h',
]),
srcs = glob([
'*.m',
]),
deps = ['//ios/BuckSample/ObjcFramework:ObjcFramework'],
frameworks = [
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
],
)
and this one’s for the framework:
apple_library(
name = 'ObjcDynamicLibrary',
srcs = glob(['ObjcFramework/*.m']),
preprocessor_flags = ['-fobjc-arc'],
exported_headers = ['ObjcFramework/SampleObjcClass.h'],
visibility = ['PUBLIC'],
info_plist = 'ObjcFramework/Info.plist',
#preferred_linkage = 'shared',
header_path_prefix = 'ObjcFramework',
frameworks = [
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
],
)
apple_bundle(
name = 'ObjcFramework',
binary = ':ObjcDynamicLibrary#shared',
extension = 'framework',
info_plist = 'ObjcFramework/Info.plist',
visibility = ['PUBLIC'],
)
To be noted that if i don’t wrap the library in a bundle and just leave it to buck to compile it as a static library, it works. however, i need to able to generate a framework for future use Also, here’s a repo for the whole example project if anyone wants to take a look over it: https://github.com/timofticiuc/BuckSample
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
cc @nguyentruongtho
Is this issue still happening? I’m able to generate a framework (
#dwarf-and-dsym,no-include-frameworks
) but I’m having issues with headers not being included.I’m guessing the issue remains?
I’m trying to generate
fat frameworks
to import on Xcode