Update Google SDKs

I packaged my Android game, uploaded it to Play Console and enabled admob. But it informed me that the SDK is out of date. I’ve been looking for a solution to this problem for days. Normally, version 18.1.0 came by default and I was able to upgrade it to 19.8.0 at most. But I need to upgrade to 20.x.x-22.x.x. In aar-imports.txt, if I choose high version numbers, I get errors during packaging. The reason for the errors is that new GMA SDKs come with some code changes. Please help me.

Sorry for using translation.

The Google Mobile Ads (GMA) SDK (com.google.android.gms:play-services-ads-lite) developer added the following note to the 19.8.0 SDK version:
This version is scheduled to be retired on June 30, 2023. See रुकना और सूर्यास्त  |  Android  |  Google for Developers for more information.

Adding 1:

The developer of the androidx.fragment:fragment (androidx.fragment:fragment) SDK reported that version 1.0.0 is outdated. We recommend upgrading to one of the following SDK versions before releasing a new version: 1.1.0+.

Adding 2:
Also add com.google.android.gms.permission.AD_ID to the Extra Tags for node section. If I add it the packaging fails.

Your advertising ID declaration in Play Console states that your app uses advertising ID. The manifest file in one of your active builds does not contain the com.google.android.gms.permission.AD_ID permission.

really not clear. and there are non english text there and vague explaining.

In my article, I translated a part into English, “Quoted part”. In Google Play, I get a warning that the Google Mobile Ads (GMS) SDK is outdated.

Same issue here with submitting an app to Google Play Store with Google AdMob. Bookmarking this post and hopefully they push an update for it.

Hi,
What is your UE version?

I’ve found simple workaround for androidx.fragment:fragment:1.0.0.

  1. Set up project in Android Studio in the location ‘yourproject’\Intermediate\Android\gradle
  2. Open File->Project Structure…
  3. Select Dependencies->AllModuls->androidx.fragment:fragment:1.0.0
  4. Check dependencies in TargetModules/Artifacts
  5. Find all places where libraries, which contains androidx.fragment:fragment:1.0.0, are implemented. (In my project these are two files: gradle\app\arr-imports.gradle and gradle\permission_library\build.gradle
  6. Find where these libraries are implemented and at the end put:
    constraints.implementation ‘androidx.fragment:fragment:1.3.6’
    in the dependency{}
  7. Sync build
  8. Check external Libraries in the project section
  9. If there are two versions of androidx.fragment:fragment (1.0.0 and 1.3.6), go back to 2. and check which library contains version 1.0.0
  10. Build AAB using Android Studio. (by default only release version contains Key Store)

It’s not the best solution, because you have to edit files for every build once again. I’ve tried to implement solution using UPL, but I failed.

My file: gradle\app\arr-imports.gradle with implemented my solution:

repositories {
	maven { url uri('D:/UnrealEngine/UE_5.3/Engine/Source/ThirdParty/Android/extras/google/m2repository') }
	maven { url uri('D:/UnrealEngine/UE_5.3/Engine/Source/ThirdParty/Android/extras/android/m2repository') }
}
dependencies {
	implementation 'com.google.android.gms:play-services-auth:18.1.0'
	implementation 'com.google.android.gms:play-services-nearby:18.1.0'
	implementation 'com.google.android.gms:play-services-games:18.0.1'
	implementation 'com.google.android.gms:play-services-plus:17.0.0'
	constraints.implementation 'androidx.fragment:fragment:1.3.6'
}

1 Like

Hi, I’ve managed to resolve the issues in 5.3 but it does require editing unreal’s source code so please beware. BACK UP before attempting this. This solution also works for those who use banner ads. Additional steps are required for those who use interstitial or other types of ads.

For the (androidx.fragment:fragment) error, answer is provided in this post: Google console telling me androidx.fragment:fragment:1.0.0 is outdated

For the (com.google.android.gms:play-services-ads-lite) and (com.google.android.gms:play-services-ads) issues do the following:

  1. Go to C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Advertising\Android\AndroidAdvertising

  2. Right click ‘AndroidAdvertising_APL’ file, select ‘properties’ and untick ‘read-only’

  3. Open ‘AndroidAdvertising_APL’ file using notepad and edit the following:

  • Change dependencies to the following:
    implementation(‘com.google.android.gms:play-services-ads:22.6.0’)
    implementation(‘com.google.android.gms:play-services-ads-lite:22.6.0’)

  • Remove ALL instances/mentions of interstitial ads. Alternatively, you can update them. I haven’t tried updating since my project doesn’t use them.

  • Remove ALL ‘@override

  1. Save and build

Hope this helps.

2 Likes

Thank you for sharing this information. It solved some of my issues or warning in the play console.

1 Like

Who search realy good solution go to the next post:

1 Like

Hi! i did the same thing as you but then the project wouldn’t package, i tried to restore what i changed by using the stuff from ue5.4 (the project is on 5.3) but still can’t export the game

I would check what errors popped up in the Output log. There should be a warning/s which will help you identify the issue

Another thing to note, if you need to revert/undo any changes to Unreals base code files, simply click on the drop down arrow linked and hit ‘Verify’. This will undo all the changes you made IF your engine is loaded from the epic launcher.

Hope this helps.
Capture

1 Like

based on my experience admob doesn’t work properly in UE5.4. If you are packaging it to “shipping” you need to fill out the “Signing for Distribution” in the Android Platform and make sure that the check box “For Distribution” is enabled in Project Packaging

when i try to include android advertising then packageing will always failed in C++,if i try to include admob support in only blueprint then then it always give me error UE5.4/5.3 same

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
PackagingResults: Error: cannot find symbol
PackagingResults: Error: cannot find symbol
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

Try this code for the AndroidAdvertising_APL.xml. It worked for me on version 5.4.2, with both banner and interstitial ads functioning correctly

AndroidAdvertising_APL.xml (13.8 KB)

1 Like