Hello, is there any good tutorial about how to int...
# multiplatform
a
Hello, is there any good tutorial about how to integrate
shared.framework
(which is exported from :*packForXcode*) via a
cococapods
into an existing App, without linking the App-project with the MPP-project (like in the Android Studio example)? We need to have the MPP-project separate from the iOS App and only use
cocoapods
to link the (prebuild) dependency. Every example I find either directly invokes :packForXcode from Xcode build-phases or uses
cocoapods
just to reference to the relative-path of the framework.
k
you should be able to specify the source repo for the project in the podspec file
a
Our idea is to build the framework, upload it to our (internal) artifactory and have a podspec, which points to the .framework in the artifactory. I can successfully run then pod install, but when I look into the Pods-project I can’t find the .framework - ist just empty…
@Kris Wong yes, thats what we are doing, but its seems the .framework never arrives in the Xcode project (after
pod install
)
k
is it executing the script phase and building the framework successfully?
the problem with hosting the vendored framework in artifactory is that it will need to be a fat framework
a
is it executing the script phase and building the framework successfully?
not in our iOS App, we just link via cocoapods
the problem with hosting the vendored framework in artifactory is that it will need to be a fat framework
iosX64 + iosArm64 ?
k
the generated podspec contains a script phase to build the framework with a matching ABI
that's what builds the framework file
a
but that means, the framework is built by the App again? can’t we have a framework which is pre-built?
k
sure, you can have a fat framework, but you will need an Xcode build phase to strip out the x86 ABI (when archiving)
but the entire point of cocoapods is that the dependencies are build locally, so why fight that?
a
good point, I guess to reduce build-times and avoid that every dev need to rebuild it (with clean build)
so the main challenge is to strip the x86 for the release (AppStore)?
k
that part is actually fairly simple. the crux is getting cocoapods to consume a vendored framework from artifactory
but I know it can be done.
a
I managed to do this (I guess) I set
s.source
and
s.vendored_frameworks
in my
podspec
and
pod install
runs without error. but when looking into the Pods project, there is no .framework. I am not sure if there is a problem with the podspec or with the framework itself
Copy code
s.source       = { :http => "<url-to-framework.zip>",
                     :sha1 => "<sha1-checksum-of-zip>" }
I believe if the sha1 or the url is wrong, it would fail running
pod install
, but thats not the case