# Upgrade to Google Play Services Ads v22.6.0 for Android Builds

**URL:** <https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Android\
**Created:** [March 24, 2024, 2:54pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977 "2024-03-24T14:54:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rush\_At\_Games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rush_at_games/32/969833_2.png) [@Rush\_At\_Games](https://forums.unrealengine.com/u/Rush_At_Games)\
**Post date:** [March 24, 2024, 2:54pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/1 "2024-03-24T14:54:57Z")

</div>

You might have noticed below warning in Google Play…

> com.google.android.gms:play-services-ads-lite has reported play-services-ads-lite:18.1.0 as outdated. You may not be able to release future versions of your app with this SDK version to production or open testing.

I’m on UE 5.3.2, the default available play-services-ads version is 18.1.0.  
With above mentioned warning from Google Play, there’s a need to upgrade to one of recent versions like v22.6.0

I’m sharing the details of modifications to upgrade as follows:

- Add followings in file: …\Engine\Build\Android\Java\aar-imports.txt

```auto
com.google.android.gms,play-services-ads,22.6.0
com.google.android.gms,play-services-ads-lite,22.6.0
com.google.android.gms,play-services-ads-base,22.6.0

```

- Add following folders at …\Engine\Source\ThirdParty\Android\extras\google\m2repository\com\google\android\gms

1. play-services-ads\22.6.0
2. play-services-ads-lite\22.6.0
3. play-services-ads-base\22.6.0

- Copy corresponding \*.aar & \*.pom files in above newly created folders from maven repo  
e.g [https://mvnrepository.com/artifact/com.google.android.gms/play-services-ads/22.6.0](https://mvnrepository.com/artifact/com.google.android.gms/play-services-ads/22.6.0)

- Modify AndroidAdvertising\_APL.xml file as follows (Note: you may need to uncheck read-only from file properties)

1. Open file …\Engine\Source\Runtime\Advertising\Android\AndroidAdvertising\AndroidAdvertising\_APL.xml

2. Add following imports instead of ‘com.google.android.gms.ads.InterstitialAd’

```auto
import com.google.android.gms.ads.interstitial.InterstitialAd;
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.FullScreenContentCallback;

```

1. Modify in function AndroidThunkJava\_ShowAdBanner() as follows

```auto
//Note arg type change
public void onAdFailedToLoad(LoadAdError adError)

```

1. Modify in function AndroidThunkJava\_LoadInterstitialAd() as follows

```auto
//interstitialAd = new InterstitialAd(this);
interstitialAd = null;

//interstitialAd.setAdUnitId(AdMobAdUnitID);

```

```auto
public void run()
{
	//interstitialAd.loadAd(interstitialAdRequest);	
	
	// Create a full screen content callback.
	FullScreenContentCallback fullScreenContentCallback = new FullScreenContentCallback() {
		@Override
		public void onAdDismissedFullScreenContent() {
			interstitialAd = null;
		}
	};

	interstitialAd.load(_activity.getApplicationContext(),
			AdMobAdUnitID,
			interstitialAdRequest,
			new InterstitialAdLoadCallback() {
				@Override
				public void onAdLoaded(InterstitialAd ad) {
					interstitialAd = ad;
					//track if the ad is loaded since we can only called interstitialAd.isLoaded() from the uiThread
					isInterstitialAdLoaded = true;
					isInterstitialAdRequested = false;
					interstitialAd.setFullScreenContentCallback(fullScreenContentCallback);
				}

				@Override
				public void onAdFailedToLoad(LoadAdError adError) {
					// Code to be executed when an ad request fails.
					Log.debug("Interstitial Ad failed to load, errocode: " + adError.getCode());
					isInterstitialAdLoaded = false;
					isInterstitialAdRequested = false;
				}
			}
	);
}

```

```auto
		//Note this listener implementation is disabled
		/*interstitialAd.setAdListener(new AdListener()
		{
			@Override
			public void onAdFailedToLoad(int errorCode) 
			{
				Log.debug("Interstitial Ad failed to load, errocode: " + errorCode);
				isInterstitialAdLoaded = false;
				isInterstitialAdRequested = false;
			}
			@Override
			public void onAdLoaded() 
			{
				//track if the ad is loaded since we can only called interstitialAd.isLoaded() from the uiThread				
				isInterstitialAdLoaded = true;
				isInterstitialAdRequested = false;
			}    
		});*/

```

1. Modify in function AndroidThunkJava\_ShowInterstitialAd() as follows

```auto
public void run()
{
	//Note arg addition
	interstitialAd.show(_activity);
}

```

Please comment on if you find any bug, mistake or better options…  
Hope it helps.

Thank you!  
Roxroria Team / Rush At Games

---

<div class="post-metadata">

**Author:** ![CapitanMaxwell](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/capitanmaxwell/32/995473_2.png) [@CapitanMaxwell](https://forums.unrealengine.com/u/CapitanMaxwell)\
**Post date:** [March 28, 2024, 12:22am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/4 "2024-03-28T00:22:37Z")

</div>

If after then you didn’t see Ads, I’ll recommend you use next blueprint code:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/b/cab3d31deb71aa3abbfd0d93e87ee9170f50d90b.png)

or this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/8/7481408770863befd1e2849f2dc4cd9912a3a3c6.png)

[AndroidAdvertising\_APL.xml](https://forums.unrealengine.com/uploads/short-url/mBePleJ7eyDMfJw1FXuGITxWfrg.xml) (15.2 КБ)

---

<div class="post-metadata">

**Author:** ![Irsandi18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Irsandi18](https://forums.unrealengine.com/u/Irsandi18)\
**Post date:** [May 8, 2024, 1:18pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/5 "2024-05-08T13:18:54Z")

</div>

Hi,  
I’ve tried it, banner is working well, but my interstitial is so laggy, event some times after appearing it stop, and can’t close immediately. And in my admob stat, its requested 500 times but no impression. it’s normal or is some setting that i miss?

Thanks

---

<div class="post-metadata">

**Author:** ![Athray](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Athray](https://forums.unrealengine.com/u/Athray)\
**Post date:** [June 6, 2024, 8:25am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/6 "2024-06-06T08:25:05Z")

</div>

This means I need to build Unreal from source code and use that for my project, right ?

---

<div class="post-metadata">

**Author:** ![SNIkerGam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SNIkerGam](https://forums.unrealengine.com/u/SNIkerGam)\
**Post date:** [June 6, 2024, 9:15pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/7 "2024-06-06T21:15:05Z")

</div>

Hello! can you guys please help me? i m stuck at the copy corresponding aar & pom, also i should delete the old play services ads/ads lite and ads base folders with the old version or just keep them and change from the old version to the new

---

<div class="post-metadata">

**Author:** ![SNIkerGam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SNIkerGam](https://forums.unrealengine.com/u/SNIkerGam)\
**Post date:** [June 6, 2024, 9:30pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/8 "2024-06-06T21:30:59Z")

</div>

Hello do you think you can help me figure it out too? if so please hit me up on discord : forgasgafaf123

---

<div class="post-metadata">

**Author:** ![Irsandi18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Irsandi18](https://forums.unrealengine.com/u/Irsandi18)\
**Post date:** [June 7, 2024, 12:27pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/10 "2024-06-07T12:27:48Z")

</div>

I think it’s useless for now, because it makes my admob showing less ads , and my ads behave unusual.

---

<div class="post-metadata">

**Author:** ![Readhunterbd1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Readhunterbd1](https://forums.unrealengine.com/u/Readhunterbd1)\
**Post date:** [June 15, 2024, 10:48am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/13 "2024-06-15T10:48:49Z")

</div>

Do Youn Know Why When i Try to Add AndroidAdvertising Plugin TO Unreal,As Documentation Said.then the packageing will always failed,

UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:867: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:892: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:958: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:979: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:999: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
UATHelper: Packaging (Android (ASTC)): Z:\app\src\main\java\com\epicgames\unreal\GameActivity.java:1041: error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): activityContext.runOnUiThread(new Runnable()  
UATHelper: Packaging (Android (ASTC)): ^  
UATHelper: Packaging (Android (ASTC)): symbol: method runOnUiThread()  
UATHelper: Packaging (Android (ASTC)): location: variable activityContext of type ContextWrapper  
PackagingResults: Error: cannot find symbol  
PackagingResults: Error: cannot find symbol  
PackagingResults: Error: cannot find symbol  
PackagingResults: Error: cannot find symbol  
PackagingResults: Error: cannot find symbol  
PackagingResults: Error: cannot find symbol  
UATHelper: Packaging (Android (ASTC)): Note: Some input files use or override a deprecated API.  
UATHelper: Packaging (Android (ASTC)): Note: Recompile with -Xlint:deprecation for details.  
UATHelper: Packaging (Android (ASTC)): \> Task :app:compileDebugJavaWithJavac FAILED  
UATHelper: Packaging (Android (ASTC)): 6 errors  
UATHelper: Packaging (Android (ASTC)): FAILURE: Build failed with an exception.  
UATHelper: Packaging (Android (ASTC)): \* What went wrong:  
UATHelper: Packaging (Android (ASTC)): Execution failed for task ‘:app:compileDebugJavaWithJavac’.  
UATHelper: Packaging (Android (ASTC)): \> Compilation failed; see the compiler error output for details.  
UATHelper: Packaging (Android (ASTC)): \* Try:  
UATHelper: Packaging (Android (ASTC)): \> Run with --stacktrace option to get the stack trace.  
UATHelper: Packaging (Android (ASTC)): 62 actionable tasks: 7 executed, 55 up-to-date  
UATHelper: Packaging (Android (ASTC)): \> Run with --info or --debug option to get more log output.  
UATHelper: Packaging (Android (ASTC)): \> Run with --scan to get full insights.  
UATHelper: Packaging (Android (ASTC)): \* Get more help at [https://help.gradle.org](https://help.gradle.org)  
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 22s  
UATHelper: Packaging (Android (ASTC)): cmd.exe failed with args /c “G:\Unreal Projects\TestingAd\Intermediate\Android\arm64\gradle\rungradle.bat” :app:assembleDebug  
UATHelper: Packaging (Android (ASTC)): (see G:\UnrealEngine-5.4.1-release\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)  
UATHelper: Packaging (Android (ASTC)): AutomationTool executed for 0h 1m 16s  
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error\_Unknown)  
UATHelper: Packaging (Android (ASTC)): BUILD FAILED  
PackagingResults: Error: Unknown Error

---

<div class="post-metadata">

**Author:** ![Nechalon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nechalon/32/967402_2.png) [@Nechalon](https://forums.unrealengine.com/u/Nechalon)\
**Post date:** [August 13, 2024, 4:36pm UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/14 "2024-08-13T16:36:13Z")

</div>

Any update on this file you linked and the post itself?

I’m using UE4.27.2 Source, and I first did everything that was in the post above, and it didnt work, I tried the 23.2.0 versions first, added the folder etc, then with 22.6.0 and still didnt work (crash on logo after packaging). So I added the file that you provided which is probably from UE5, the file’s length gets to around 479, while what you linked is 532 lines long (so probably they modified it since the release of UE5).

The game crashes with either file and either versions. As soon as the Unreal Engine logo appears it immediately closes in a tenth of a second.

Does this solution still work for anybody? Or is there a better solution?

---

<div class="post-metadata">

**Author:** ![gomi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gomi/32/1148548_2.png) [@gomi](https://forums.unrealengine.com/u/gomi)\
**Post date:** [August 20, 2024, 11:08am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/15 "2024-08-20T11:08:14Z")

</div>

**Can this work for UE4\_27\_2 ???**

---

<div class="post-metadata">

**Author:** ![gomi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gomi/32/1148548_2.png) [@gomi](https://forums.unrealengine.com/u/gomi)\
**Post date:** [August 20, 2024, 11:18am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/16 "2024-08-20T11:18:17Z")

</div>

I use 4.27.2 too did you get any solution???

---

<div class="post-metadata">

**Author:** ![Nechalon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nechalon/32/967402_2.png) [@Nechalon](https://forums.unrealengine.com/u/Nechalon)\
**Post date:** [August 20, 2024, 11:51am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/17 "2024-08-20T11:51:04Z")

</div>

not that one, I have used an older version of google play services that was in UE 5.3, then later realised that the UShowExternalLoginUI never ran, now the first time it did, it did show up the google login.

But im not going to use the google leaderboard, its insanely limited, I rather use Firebase for leaderboards

---

<div class="post-metadata">

**Author:** ![Rush\_At\_Games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rush_at_games/32/969833_2.png) [@Rush\_At\_Games](https://forums.unrealengine.com/u/Rush_At_Games)\
**Post date:** [May 27, 2025, 4:45am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/18 "2025-05-27T04:45:21Z")

</div>

I ran into this problem (runOnUiThread symbol not found while build game app for Android Target 34) yesterday on UE 5.5.4  
Please see the solution at [Play Games Services V2 Migration - #6 by Rush\_At\_Games](https://forums.unrealengine.com/t/play-games-services-v2-migration/2522879/6)

---

<div class="post-metadata">

**Author:** ![dendnk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dendnk/32/945774_2.png) [@dendnk](https://forums.unrealengine.com/u/dendnk)\
**Post date:** [December 25, 2025, 12:55am UTC](https://forums.unrealengine.com/t/upgrade-to-google-play-services-ads-v22-6-0-for-android-builds/1769977/19 "2025-12-25T00:55:33Z")

</div>

It helped to package Android build on 5.7 too. Thank you a lot!
