I have the following situation:
I need to integrate a third party framework into my own (local) cocoapod. The framework consist out of a .framework and a .bundle file. My .podspec file looks like this:
Pod::Spec.new do |s|
s.name = 'flutter_wrapper'
s.version = '0.0.1'
s.summary = 'Flutter wrapper for the client framework Mobile SDK'
s.description = <<-DESC
Wraps the [client Mobile SDK][1] for use in Flutter apps.
[1]: https://some.client.library.url/mobile-sdk
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :git => 'https://gitlab.com/somesecretrepo' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '8.0'
s.vendored_frameworks = 'Resources/OPPWAMobile.framework'
s.resource = 'Resources/*'
s.resource_bundle = { 'OPPWAMobile' => 'Resources/*' }
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'NO',
'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64',
'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_ROOT)/../../../ios/Classes/BridgingHeader.h'
}
s.swift_version = '5.0'
end
When I build the project and run it, the app crashes as soon as I instantiate one of the ViewControllers inside the the framework, telling me that it couldn't load the nib:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </private/var/containers/Bundle/Application/3EA9EB93-83AC-4CD5-BA87-748D318715FA/Runner.app> (loaded)' with name 'OPPWAMobile-Resources.bundle/OPPPaymentSchemeViewController''
I'm messing around with it for a few days, trying to figure this out but I'm running out of ideas how to fix this. I think the problem is how the nib file gets loaded from within the framework, because the bundle name is different or generally in some other context at that point. When I copy the bundle into the parent project's structure, it works perfectly fine - but that's not what I want.
How can I make this work properly?