UE 5.3 Mobile Developer get In-App purchases working without crash on Android

Hello,
I am using UE 5.3 and trying to implement in app purchases. Signing in to Google Play and Leaderboards work but the second any of the 2 in app purchases nodes are called, the app crashes. There isn’t anything online about this issue. I have tried different Android Studio versions, different SDK versions, different NDK versions, different JDK versions and still no luck! I am using Blueprints not C++.

Error from log:
Assertion failed: false && “Java JNI call failed with an exception.” [File:./Runtime/Core/Private/Android/AndroidJavaEnv.cpp] [Line: 231]

  • I am using 1 plugin called EasyAdsPro for ads but the problem I am having is related to In-App-Purchases
  • The project is all blueprints.
  • I got the packaging to work using:
    Flamingo 2022.2.1 Patch 2
    Android SDK 33
    NDK r25b
    JDK 20 (also tried 17,18,19)

Please find attached the nodes that crash the game once they are called with the error specified in the job posting

Another thread with full log (same as mine):

Any help is much appreciated! It’s been a couple of days and I’m going crazy haha

1 Like

Hi,
you need use source code build of unreal engine, and change the file
Engine/Source/Runtime/Core/Private/Android/AndroidJavaEnv.cpp
in line 282

FScopedJavaObject FJavaHelper::ToJavaStringArray(JNIEnv* Env, const TArray& UnrealStrings)
{

// Change from
// jclass JavaStringClass = AndroidJavaEnv::FindJavaClass(“java/lang/String”);
// to
jclass JavaStringClass = Env->FindClass(“java/lang/String”);

1 Like

Does In-App purchases work for anyone in UE 5.3 on iOS? I haven’t been able to get it working due to this error:

UInAppPurchaseCallbackProxy::Trigger - Invalid player UniqueNetId

This is happening because in the InAppPurchaseCheckoutCallbackProxy::TriggerCheckout() function, this line is failing on IsValid() check:

if( FUniqueNetIdRepl PurchasingPlayer = PlayerController->GetLocalPlayer()->GetUniqueNetIdFromCachedControllerId(); PurchasingPlayer.IsValid())

Any luck with in-app purchases with the latest hotfix UE 5.3.2?

Nope, nothing changed. Really hoping for a fix soon this is insane.

Still broken for me in UE 5.3.2 as well.

Have we gotten confirmation that this is indeed an issue with UE and not something we are doing wrong? Seems like this issue would be much bigger than it is if it was broken for everybody. Especially since iOS broke as of UE 5.1, which was released about 1 year ago. And Android as of UE 5.3, which is coming up on 6 months.

Out of all of the hundreds/thousands of UE games, we are the only ones seeing and reporting this problem in the last year?

It is very strange. I think we should all submit bug reports. I already did twice but it never showed up on the bugs website for some reason.

The problem is still here in 5.4.

1 Like

they just keep adding “features” to the “engine” while the most important parts are falling apart, wtf kind of business are they running?

3 Likes

Well, it’s been almost a year, and IAP are still not working.

Epic is ignoring our bug reports and keeps releasing new patches without fixing this.

1 Like

I’m starting to believe they hate mobile developers. I’ve spent months looking for solutions and the problem is with them.
5.3.2 Same problems / 5.4 Same problems / 5.4.4 Same problems
The only version I didn’t have any problems with on Android was the version 4.27, but it’s impossible for me to go back to this one because even downgrading projects they make it a nightmare.

Still broken on 5.5 :slight_smile:

Still broken on 5.5.4 :slight_smile:

Has anyone had success bypassing these issues via control in UAT and Xcode?

Hello guys!

I’ve checked the source code for UE5.7, and it seems that Epic has fixed the files that were causing the issue!

I don’t know yet if IAPs will work, I’m currently uploading a shipping build on the Play Console and I’ll try when the app is approved.

Quick guide to fix all the errors you may encounter:

  • Java 21
  • NDK 27.2 (not the 27.0, it doesn’t work)
  • Disable the plugin “Online Subsystem Google”. It is now totally obsolete, you need to use the “Online Subsystem Google Play” plugin now.
  • The “Support admob” feature is a bit broken. Go to “Engine\Source\Runtime\Advertising\Android\AndroidAdvertising” and replace the file “AndroidAdvertising_APL.xml” with this one.
  • Go to “UE_5.7\Engine\Build\Android\Java\gradle\app” and open build.gradle. At the very end under “dependencies”, add these 2 lines:

def billing_version = “7.1.1”
implementation “com.android.billingclient:billing:$billing_version”

  • You don’t need the AndroidManifestOverride.txt anymore. All default authorizations have been removed.
  • If you had “Extra tags for manifest node”, you need to remove them or the engine will refuse to compile.

I’ll keep you up-to-date!


Update : IAPs still don’t work. But at least the 5.7 version is compliant with the new Google Play rules like the 16KB memory pages.

Update 2 : IT WORKS GUYS! IAP ARE NOW WORKING ON UNREAL 5.7!

SOLUTION:

In “Engine\Plugins\Online\Android\OnlineSubsystemGooglePlay\Source”, you have a file called “OnlineSubsystemGooglePlay_UPL.xml”.

Inside, you have this:

The thing is, usually you are supposed to set this value on true or false inside the file “AndroidGame.ini” of your project. That’s what the official documentation always said.

I don’t know when it stopped working or even if it was related with the other issue, but: you just have to set the default value on “true” directly in the “OnlineSubsystemGooglePlay_UPL.xml” file.

Create a shipping build, upload it on Google Play… and enjoy the IAPs!

Note that it will only work in Closed Testing, Open Testing and Production. It won’t work in Quick Launch or in internal sharing.


Let me know if it worked for you!