Hi everyone, I'm working on integrating AdMob into...
# multiplatform
s
Hi everyone, I'm working on integrating AdMob into a Kotlin/Compose Multiplatform project for both Android and iOS. I've successfully implemented AdMob ads on the Android side, but I'm facing issues getting it to work on iOS—specifically when trying to integrate the AdMob SDK via CocoaPods. Has anyone here implemented AdMob for iOS in a KMP project? Any guidance, example projects, or tips would be really appreciated! Thanks in advance
a
What kind of issues are you facing?
s
I'm currently implementing AdMob ads for iOS in a Kotlin Multiplatform project using Jetpack Compose Multiplatform. I’ve added the AdMob SDK to the
Podfile
as follows:
Copy code
pod 'Google-Mobile-Ads-SDK'
The pods are being installed successfully, and integration appears fine. On the Android side, AdMob ads are working perfectly. However, when I try to build the iOS app through Xcode, I encounter the following error:
Copy code
Multiple commands produce '/Users/User_Name/Library/Developer/Xcode/DerivedData/iosApp-.../Build/Products/Debug-iphoneos/YourApp.app'
Here’s what I’ve tried so far: • Cleaned project/invalidate caches in Android Studio • Deleted
DerivedData
folder in Xcode • Ran
pod deintegrate
and
pod install
again • Verified there are no duplicate entries for output paths or targets But the issue still persists.
j
Is AdMob available via SPM?
k
Check Product Name in XCode Build settings, sometimes after integration of cocoapods via gradle, it gets reset to empty. Although in your error you do have Product Name (YourApp.app), but still check it out
e
Just in case you are interested, I have implemented admob for both platforms very easily with this library: https://github.com/LexiLabs-App/basic-ads . I totally recommend it