I have recently been seeing this warning when uploading to Google Play: “We’ve detected that this app is using an old version of Google Play Billing”. According to Google Play every new app update after November 1, 2021 must use Google Play Billing Library version 3.
How can I update to this billing library in Unreal Engine so I can avoid not being able to update my app on November 1st?
I’ve yet to test it out but looking at:
\Epic Games\UE_4.26\Engine\Plugins\Online\Android\OnlineSubsystemGooglePlay\Source\OnlineSubsystemGooglePlay_UPL.xml
<buildGradleAdditions>
<if condition="bUseGooglePlayBillingApiV2">
<true>
<insert>
dependencies {
implementation 'com.android.billingclient:billing:3.0.0'
}
</insert>
</true>
</if>
</buildGradleAdditions>
So upgrading to 4.26 should do it
Thanks, that seems to have worked.
God you just saved my career. Thx man
thank you man
I just went through the ringer looking for the solution to this on 4.27.2, trying many ideas posted on the internet, with no avail. My solution was this:
Download this plugin, add it to your project, and enable it in it’s settings under Plugins in Project Settings. You don’t have to use it or do anything with it. It just includes the library. Can confirm this will pass the Google Play store check.
I didn’t get it to work and I’m using 4.27.2. Any tips?
Anyone know how to solve this? I facing the same situation.
My this file content is but still not working
<?xml version="1.0" encoding="utf-8"?>
<!--OnlineSubsystemGooglePlay plugin additions-->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<init>
<log text="Subsystem Google Play SDK Android init"/>
<setBoolFromProperty result="bEnableGooglePlaySupport" ini="Engine" section="/Script/AndroidRuntimeSettings.AndroidRuntimeSettings" property="bEnableGooglePlaySupport" default="false"/>
<setBoolFromProperty result="bSupportsInAppPurchasing" ini="Engine" section="OnlineSubsystemGooglePlay.Store" property="bSupportsInAppPurchasing" default="false"/>
<setIntFromProperty result="RequestCodeForPlayGamesActivities" ini="Engine" section="/Script/AndroidRuntimeSettings.AndroidRuntimeSettings" property="RequestCodeForPlayGamesActivities" default="80002"/>
<dumpvars/>
</init>
<prebuildCopies>
<log text="Copying Google Play wrapper java file"/>
<copyFile src="$S(PluginDir)/Java/com/epicgames/unreal/GooglePlayGamesWrapper.java"
dst = "$S(BuildDir)/src/com/epicgames/unreal/GooglePlayGamesWrapper.java" />
<if condition="bSupportsInAppPurchasing">
<true>
<log text="Copying Google Play store helper java file"/>
<copyFile src="$S(PluginDir)/Java/com/epicgames/unreal/GooglePlayStoreHelper.java"
dst = "$S(BuildDir)/src/com/epicgames/unreal/GooglePlayStoreHelper.java" />
</true>
</if>
</prebuildCopies>
<!-- gradle dependencies additions -->
<buildGradleAdditions>
<if condition="bSupportsInAppPurchasing">
<true>
<insert>
dependencies {
implementation 'com.android.billingclient:billing:6.0.1'
}
</insert>
</true>
</if>
</buildGradleAdditions>
<!-- optional additions to proguard -->
<proguardAdditions>
<if condition="bEnableGooglePlaySupport">
<true>
<insert>
-keep class com.epicgames.unreal.GooglePlayGamesWrapper {
public *;
}
</insert>
</true>
</if>
<if condition="bSupportsInAppPurchasing">
<true>
<insert>
-keep class com.epicgames.unreal.GooglePlayStoreHelper {
public *;
}
</insert>
</true>
</if>
</proguardAdditions>
<gameApplicationOnCreateAdditions>
<insert>
GooglePlayGamesWrapper.Initialize(getApplicationContext());
</insert>
</gameApplicationOnCreateAdditions>
<gameActivityAndroidThunkJavaIapBeginPurchase>
<if condition="bSupportsInAppPurchasing">
<true>
<insert>
public boolean AndroidThunkJava_IapBeginPurchase(String[] ProductIds, String AccountId)
{
Log.debug("[JAVA] - AndroidThunkJava_IapBeginPurchase");
boolean bTriggeredPurchase = false;
if( IapStoreHelper != null )
{
// sha-256 the accountId and get the hex string representation
String ObfuscatedAccountId = null;
if (AccountId != null)
{
try
{
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] sha256hash = md.digest(AccountId.getBytes("UTF-8"));
StringBuilder builder = new StringBuilder(sha256hash.length * 2);
for (byte b : sha256hash)
{
builder.append(String.format("%02x", b));
}
ObfuscatedAccountId = builder.toString();
}
catch (NoSuchAlgorithmException ae)
{
}
catch (UnsupportedEncodingException ee)
{
}
}
bTriggeredPurchase = IapStoreHelper.BeginPurchase(ProductIds, ObfuscatedAccountId);
}
else
{
Log.debug("[JAVA] - Store Helper is invalid");
}
return bTriggeredPurchase;
}
</insert>
</true>
</if>
</gameActivityAndroidThunkJavaIapBeginPurchase>
<!-- optional additions to GameActivity imports in GameActivity.java -->
<gameActivityImportAdditions>
<if condition="bSupportsInAppPurchasing">
<true>
<insert>
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
</insert>
</true>
</if>
</gameActivityImportAdditions>
<gameActivityClassAdditions>
<insertValue value="public static int REQUEST_CODE_SHOW_GOOGLEPLAY_UI = $I(RequestCodeForPlayGamesActivities);"/>
<insertNewline/>
</gameActivityClassAdditions>
<gameActivityIapSetupServiceAdditions>
<if condition="bSupportsInAppPurchasing">
<true>
<insert>
if (getPackageManager().checkPermission("com.android.vending.BILLING", getPackageName()) == getPackageManager().PERMISSION_GRANTED)
{
IapStoreHelper = new GooglePlayStoreHelper(this, Log);
if (IapStoreHelper != null)
{
Log.debug("[JAVA] - AndroidThunkJava_IapSetupService - Setup started");
}
else
{
Log.debug("[JAVA] - AndroidThunkJava_IapSetupService - Failed to setup IAP service");
}
}
else
{
Log.debug("[JAVA] - AndroidThunkJava_IapSetupService - You do not have the appropriate permission setup.");
Log.debug("[JAVA] - AndroidThunkJava_IapSetupService - Please ensure com.android.vending.BILLING is added to the manifest.");
}
</insert>
</true>
</if>
</gameActivityIapSetupServiceAdditions>
<gameActivityOnActivityResultAdditions>
<insert>
if (requestCode == REQUEST_CODE_SHOW_GOOGLEPLAY_UI)
{
Log.debug("[JAVA] - GooglePlay external activity UI closed (achievements or leaderboards)");
}
</insert>
</gameActivityOnActivityResultAdditions>
</root>