[FR] Build Unity plugin from source.
[REQUIRED] Step 1: Describe your environment
- Unity version: 2021.3.42f1 (does not really matter, can be any of the latest stable)
- Google Mobile Ads Unity plugin version: 9.4.0 and later
- Plugin installation method: building from sources
- Platform: iOS
- Platform OS version: iOS 12 and later
- Any specific devices issue occurs on: - (not device related issue)
- Mediation ad networks used, and their versions: no mediation used
[REQUIRED] Step 2: Describe the problem
Not that long ago there was an issue (3181) where UMP was requested as a completely separated package from AdMob. As far as this feature is still somewhere in the plans, we still can make this separation ourselves using sources provided with every release (for example, here is the link for the latest 9.5.0 release sources), despite it requires some nontrivial steps to make it work.
It looks like for iOS things has been changed since 9.4.0: preloaded ads feature was added, but some headers is nowhere to be found:
- GADAppOpenAd_Preview.h
- GADInterstitialAd_Preview.h
- GADMobileAds_Preview.h
- GoogleMobileAds/GADPreloadConfiguration_Preview.h
- GADRewardedAd_Preview.h
Those headers named with -preview suffix are also not presented in the latest iOS SDK 11.13.0.
If I try to install plugin via .unitypackage, it builds fine, so the headers are there inside unity-plugin-library.a I guess.
So the question is - is it possible to add those missing headers so we can build from the sources again? Just some commit will be fine to grab, it's not really necessary to wait longer for the next official release.
(It is still possible to build separate packages on Android platform with 9.4.0 and 9.5.0 sources)
Steps to reproduce:
Unfortunately, steps are too complex to reproduce, but I think it's not needed yet at this point of discussion.
Relevant Code:
// No code needed for this issue
Thanks for raising this issue,
Give me some time to look into this issue. In the mean time, is it possible to use the unityPackage ?
is it possible to use the unityPackage?
Yes, it is. The only thing is when another ads mediation is used (e.g. ironSource) AdMob related only scripts may be not fully stripped from the build and thus staying inside unused.
So my current approach is to use 9.3.0 from sources, but bump up AdMob's iOS and Android SDK's to the versions from the latest 9.5.0 release - just to be in flow with mediation adapters.
@Remstam is it working from unity package or should I not uprade to 9.5.0 ?
@Remstam is it working from unity package or should I not uprade to 9.5.0 ?
@RomainBitard It is working from unity package (it builds without errors at least)
Can't build for iOS Undefined symbol: _OBJCCLASS$_GADPreloadConfiguration
Any workaround other than downgrading the AdMob version? (It worked for me, but I don't want to downgrade)
Any updates, everyone? Can I get all missing headers in v9.4 without using UnityPackage?
@tuanlihuhu As far as this commit became available, we can guess that the upcoming release will come up with a fix.
Hi @NVentimiglia,
3181 Does it make sense that the UMP sdk is still embedded in the Admob sdk after over a year of my feature request? Although it is built on the Admob website, UMP is a separate service and should be separate. Even for games that don't have any ads but add Analytics, UMP is a requirement.
Now I have to work on re-separating the latest version due to the new updates. We are using Unity level play and we don't want to import the entire Admob sdk to be able to use UMP. This will cause problems in most cases.
Ump is updating. Instead of embedding UMP in Admob, you should separate the sdk and add it as a dependency. You will have to do this eventually and it is best to do it before it gets too involved. As I have shown before, it shouldn't take too long for you to migrate it to a separate package.
Hi @NVentimiglia, v10.0.0 has been released, but the *_Preview.h files are still not included. Will these files be provided in the next version?
So I finally made it back to check if there is a working version to build from sources, and here is the current situation:
- 9.4.0 - 10.0.0 - preview headers are not removed (or links to them were not added) yet, build from sources is impossible
- 10.0.0 - Despite the efforts made for 10.0.0 release it still contains link to GADPreloadConfiguration_Preview.h which is nowhere to be found too - and thus build from sources is again impossible
- 10.1.0 - 10.2.0 - for some reason preview headers were added back, so we are stuck again with original post question
So as of now 9.3.0 remains the last buildable version (from sources).
Even with version 10.3.0, building from source still doesn't work. (_Preview.h is not included.)
Thanks, I am letting the team know. I will update here if I find a work around.
Google Mobile Ads Unity plugin:v10.4.2
Undefined symbol errors when GMA_PREVIEW_FEATURES is not defined
When building a Unity iOS project with the Google Mobile Ads Unity plugin, the following undefined symbol errors occur if GMA_PREVIEW_FEATURES is not defined:
Undefined symbol: _GADUAppOpenIsPreloadedAdAvailable
Undefined symbol: _GADUAppOpenPreloadedAdWithAdUnitID
Undefined symbol: _GADUCreatePreloadConfiguration
Undefined symbol: _GADUCreatePreloadConfigurationV2
Undefined symbol: _GADUGetPreloadConfigurationAdFormat
Undefined symbol: _GADUGetPreloadConfigurationAdUnitID
Undefined symbol: _GADUGetPreloadConfigurationBufferSize
Undefined symbol: _GADUGetPreloadConfigurationV2AdUnitID
Undefined symbol: _GADUGetPreloadConfigurationV2BufferSize
Undefined symbol: _GADUInterstitialIsPreloadedAdAvailable
Undefined symbol: _GADUInterstitialPreloadedAdWithAdUnitID
Undefined symbol: _GADUPreloadWithCallback
Undefined symbol: _GADURewardedIsPreloadedAdAvailable
Undefined symbol: _GADURewardedPreloadedAdWithAdUnitID
Undefined symbol: _GADUSetPreloadConfigurationAdFormat
Undefined symbol: _GADUSetPreloadConfigurationAdRequest
Undefined symbol: _GADUSetPreloadConfigurationAdUnitID
Undefined symbol: _GADUSetPreloadConfigurationBufferSize
Undefined symbol: _GADUSetPreloadConfigurationV2AdRequest
Undefined symbol: _GADUSetPreloadConfigurationV2AdUnitID
Undefined symbol: _GADUSetPreloadConfigurationV2BufferSize
Undefined symbol: _GAMUInterstitialIsPreloadedAdAvailable
Undefined symbol: _GAMUInterstitialPreloadedAdWithAdUnitID
On the native (iOS) side, these bridge functions are wrapped with #if GMA_PREVIEW_FEATURES.
On the C# side, the extern declarations are always included.
Ensure that C# extern declarations are also wrapped with #if GMA_PREVIEW_FEATURES, or Provide dummy native implementations in the #else branch so that symbols always exist, even when preview features are disabled.
As a result, when GMA_PREVIEW_FEATURES is not defined, the native implementations are stripped out, but C# still references them, leading to linker errors
Ensure that C# extern declarations are also wrapped with #if GMA_PREVIEW_FEATURES, or
Provide dummy native implementations in the #else branch so that symbols always exist, even when preview features are disabled.
Hi @NVentimiglia , I just wanted to follow up on this issue. Is there any update or timeline regarding a fix/workaround? Thanks in advance.
Hi, We still have an goal to support this, but have not be able to roll it out just yet.