-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prebid Linking to SPM by building it to XCFramework #961
Comments
UPD: I was able to launch the app without crash using tips from here Alamofire/Alamofire#3051 Maybe you can use this info to do some modifications and put it to your docs, in the SPM section. |
Hi @mrbodich , Can you share the Package.swift file that you created for this, Mine is something like this, currently I see the same issue as you
|
Hi @ankit-thanekar007 , @mrbodich short note about the 4 frameworks. Most probably, you don't need all of them. The main one is PrebidMobile - the Prebid SDK itself. All others are connectors to the primary ad server SDK. And they should be used only with particular integration of Rendering API. If your primary ad server is GAM, you don't need any if these dependencies in your app. As a result, you won't need to manage the issue with third-party libraries like FBLPromises because Prebid SDK itself doesn't use any dependencies. |
Hi @YuriyVelichkoPI. I have AdMob and want to use Prebid with the Ad Mediation. Don't I need XCPrebidMobileAdMobAdapters? I believe I would need it. Your documentation says
|
@ankit-thanekar007 You have to make a target with each framework first, and only after that use this target in the product library. PS: @ankit-thanekar007 Please read my second message where I have described how to deal with this error
|
you will definitely need AdMobAdapter, but you won't need the other two - GAMEventHandlers and AppLovinMAXAdapters. I see in the @ankit-thanekar007 message that he added all frameworks and trying to say that some of them can be redundant. |
@YuriyVelichkoPI I understand that I don't need other two right at this moment. But not sure it's really a trouble that I've made a comprehensive example for you as the package developers, to have the best example with all frameworks linked)) Anyway, the topic is how to link your package fully with the SMP, let's avoid the specific app logic discussion pleeeeease))) I just wanted to help you with the info I have found spending my time. |
@mrbodich sorry for taking your time, go ahead. |
@mrbodich @YuriyVelichkoPI Thanks for the inputs. I'll test the changes and revert back to you guys ! |
@YuriyVelichkoPI Can you as the framework vendor please consider providing the XCFramework as a ZIP archive directly. E.g. by uploading it somewhere publicly accessible like the assets of the GitHub release. 🙏 That way, us framework consumers can use the framework directly in SPM by accessing it as a remote (URL-based) binary target without any additional overhead on our side. Additionally, this would also work around the issue that the framework is not available in SPM anymore since version 2.0.0 (#640). |
Any update on getting pre-compiled XCFrameworks. I've followed the steps to do it myself, but now with the latest update, there is a new version of Ruby required, and it is another hassle to upgrade my system. Vs just updating the version of the package. |
Hi @chwo, unfortunately, I'm not a framework vendor. Let me ping @alexsavelyev and @mmullin to bump this issue into the committee meeting and prioritize it in the backlog. |
It looks feasible to support SPM by publishing the frameworks on GitHub into Assets. Here is the API how to upload the assets: https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#update-a-release-asset All the info provided above should be considered in supporting SPM as well. cc: @alexsavelyev, @mmullin, @jsligh |
Hello guys @YuriyVelichkoPI @ankit-thanekar007 . Some time passed, checking the base... Please check, exactly same Google does here, they pre-build a binary and created a repo with SPM support. Can you please tell me the status of this issue, and if you have plans to make SMP support in this really simple way? PS: I was able to build all 4 submodules with v2.2.3 and import them to the parent package, and build the project, and call some parameters from each object created from one of 4 respective package. |
Hi @mrbodich! Yes, there is an intent to support SPM via rebuild binaries. Unfortunately, there are no resources or volunteers to do it. So, for now, the task is still in the backlog. |
Looks like CocoaPods trunk is going to be moving to read-only mode in two years. |
Considering the fact this package does not support the Swift Package Manager, I have tried to build it using
scripts/buildPrebidMobile.sh
.I have modified the shell script a bit so it is executed without errors (removed
eval
wrapper for the lastxcodebuild
, changedarch
for thesimulator
toarm64
for the M processor).As an output, I get 4 frameworks.
PrebidMobile — I was able to link it in the Package.swift (to my ads module package) using these
from this suggestion (but skipping .c and .h files linking): https://developer.apple.com/forums/thread/651069?answerId=769888022#769888022
This method worked for
XCPrebidMobile
. I can build and run the app, tried to call Prebid.shared.description and runtime did not crash.But the same for
XCPrebidMobileAdMobAdapters
makes runtime crash on the app launch. I will attach the crash logs in the end.As I see, the problem is caused by
FBLPromises
(PromisesObjC
) which is not found.Maybe it is possible to figure out how to solve this error and it should allow to link other 3 frameworks?
It would be a really huuuuge trouble if we will have to somehow link this package using Cocoapods in the modular project with cross-dependencies of SPM modules, and even implemented macros.
Also attaching the slightly modified build script which worked for me. Rows 80, 89-94.
buildPrebidMobile.txt
Thank you.
The text was updated successfully, but these errors were encountered: