Google Mobile Ads SDK via SwiftPM in a custom project framework

65 views
Skip to first unread message

mrbl...@googlemail.com

unread,
Feb 28, 2023, 3:25:27 AM2/28/23
to Google Mobile Ads SDK Developers
Hi,

our iOS is separated into multiple frameworks. One framework is responsible for advertising. Till today we use CocoaPods for downloading and integration GoogleMobileAds SDK into the advertising framework.

With this setup the GoogleMobileAds SDK is able to find the main app info.plist settings for the Ad Manager.

Now we want to move away from CocoaPods and make use of SwiftPM. I was able to import the SDK into the advertising framework and it is compiling. But when launching the app, then the GoogleMobileAds SDK is complaining about a missing Info.plist configuration. I copied the GAD SDK required Info.plist keys from the main app target into the advertising framework where a new Info.plist is created. But the SDK contains complaining about a missing Info.plist.

Can someone give me guidance how to solve this? It was working when using CocoaPods where the SDK was a dynamic linked framework. Now it is a SwiftPM static framework and stopped working.

Thanks,
Thomas

Mobile Ads SDK Forum Advisor

unread,
Feb 28, 2023, 8:18:26 AM2/28/23
to google-adm...@googlegroups.com

Hello,

Thank you for reaching out to us.
 

For clarification, have you tried following our guide for implementing Swift Package Manager? If migrating from a CocoaPods-based project, run pod deintegrate to remove CocoaPods from your Xcode project. The CocoaPods-generated .xcworkspace file can safely be deleted afterward. If you're adding the Google Mobile Ads SDK to a project for the first time, this step can be ignored.
 

Regards,

Google Logo Mobile Ads SDK Team


ref:_00D1U1174p._5004Q2jHWS6:ref

mrbl...@googlemail.com

unread,
Feb 28, 2023, 8:48:17 AM2/28/23
to Google Mobile Ads SDK Developers
I read the guide. 

But my problem is that Google Mobile Ads SDK is not part of the main target. It is a dependency for our custom advertising framework. The difference between Swift Package Manager and CocoaPods integration is, that the Google Mobile Ads SDK did become a static linked one. For CocoaPods it was a dynamic linked framework.

I'm wondering if there is a alternative way of configuring the SDK beside Info.plist if this is not supported for my special setup.

Best,
Thomas

PS: Sorry if the message is now send twice. But I could not see that my first reply is send.

mrbl...@googlemail.com

unread,
Mar 3, 2023, 7:15:44 AM3/3/23
to Google Mobile Ads SDK Developers
Hello,

I've uploaded the sample app using the provided form.

I also tested the recommendation by adding the framework own Info.plist file. But this cause an error of having twice the same Info.plist file.

Best,
Thomas

Mobile Ads SDK Forum Advisor

unread,
Mar 3, 2023, 1:26:05 PM3/3/23
to google-adm...@googlegroups.com

Hi Thomas,

Thank you for providing your sample app project on this. However, upon checking, I was able encounter an error in my end with regard to the signing certificate. With this, can you provide us another sample app project that doesn't return this error? If the error we encounter still exist, you can also try to modify our sample app project with your implementation for us to further check. I've also tried our sample app project and try to use the swift package manager, and was able to build the app on the simulator.

You can provide the following details via reply privately to author option or directly provide it to the link below.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002jHWS6QAO&entry.80707362=00169002

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Reply all
Reply to author
Forward
0 new messages