I have created a FramweworkA written in Swift, which uses a FrameworkB written in Objective-C.
These two frameworks are dynamic.
I have no error when I integrate my FrameworkA to my iOS application.
The problem is that Apple doesn't allow me to have a Framework inside a Framework when I upload my App on testFlight.
Validation Error: Invalid Bundle. The bundle at ... contains disallowed file 'Frameworks'
During my research, I saw that you can create an Umbrella Framework but that it is not recommended.
Is the Umbrella Framework still possible? What is the best solution according to you?
Knowing that this Framework will be available to customers and therefore I would like to have only one Framework.
Thanks
CodePudding user response:
Few days back, I was stuck in the same kind of issue when I was building a dynamic Framework A which is using Framework X internally. It can't use Framework A alone, as I need to add Framework X inside my iOS App. I just want a single framework which can be exported to iOS App Bundle.
Since, Umbrella Framework was not a preferred way to achieve this. I went for Cocoapods instead where I was able to abstract My Framework X inside Framework A -
My Podspec file was something like this -
Pod::Spec.new do |s|
s.name = "MySDK"
s.version = "1.0.1"
s.summary = "xxxxxxx"
s.description = <<-DESC
"xxxxxxxxxxxxxx."
DESC
s.homepage = "https://xxxxxxxxxx"
s.author = { "Abhishek Ravi" => "xxxxxx" }
s.source = { :http => 'file:' __dir__ '/' }
s.source_files = "*"
s.vendored_frameworks = 'FrameowkrA.xcframework', 'FrameowkrB.xcframework'
s.platform = :ios
s.swift_version = "5.0"
s.ios.deployment_target = '12.0'
end
Now, you can ask your iOS app to consume the SDK via Pod -
pod 'MySDK', :git => 'ssh://GIT-PATH.git', :branch => 'master'