googleads-mobile-unity icon indicating copy to clipboard operation
googleads-mobile-unity copied to clipboard

[FR] Build Unity plugin from source.

Open Remstam opened this issue 1 year ago • 15 comments

[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:

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

Remstam avatar Jan 13 '25 20:01 Remstam

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 ?

NVentimiglia avatar Jan 15 '25 20:01 NVentimiglia

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 avatar Jan 16 '25 12:01 Remstam

@Remstam is it working from unity package or should I not uprade to 9.5.0 ?

RomainBitard avatar Jan 26 '25 07:01 RomainBitard

@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)

Remstam avatar Jan 27 '25 17:01 Remstam

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)

Axrr44 avatar Mar 04 '25 02:03 Axrr44

Any updates, everyone? Can I get all missing headers in v9.4 without using UnityPackage?

tuanlihuhu avatar Mar 18 '25 00:03 tuanlihuhu

@tuanlihuhu As far as this commit became available, we can guess that the upcoming release will come up with a fix.

Remstam avatar Mar 18 '25 08:03 Remstam

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.

KarahanOnarlar avatar Mar 31 '25 15:03 KarahanOnarlar

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?

takazawa-gg avatar Apr 22 '25 05:04 takazawa-gg

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).

Remstam avatar Jun 17 '25 20:06 Remstam

Even with version 10.3.0, building from source still doesn't work. (_Preview.h is not included.)

takazawa-gg avatar Jul 09 '25 11:07 takazawa-gg

Thanks, I am letting the team know. I will update here if I find a work around.

NVentimiglia avatar Jul 24 '25 20:07 NVentimiglia

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.

takata-gg avatar Sep 10 '25 10:09 takata-gg

Hi @NVentimiglia , I just wanted to follow up on this issue. Is there any update or timeline regarding a fix/workaround? Thanks in advance.

takata-gg avatar Sep 18 '25 01:09 takata-gg

Hi, We still have an goal to support this, but have not be able to roll it out just yet.

NVentimiglia avatar Nov 18 '25 23:11 NVentimiglia