Crash calling Start an In-App Purchase
in Blueprints in Unreal 5.3. Make an In-App Purchase v2
also crashes with the same error. In Unreal 4.27 Make an In-App Purchase v2
works fine.
When I use UE 5.3 and Android Target SDK 29 it works perfectly. When I upgrade to Target SDK >=30 a Java JNI crash occurs.
The call inside of:
AndroidJNI.cpp:
AndroidThunkCpp_Iap_BeginPurchase() →
FJavaHelper::ToJavaStringArray() is failing on this call:
jclass JavaStringClass = AndroidJavaEnv::FindJavaClass(“java/lang/String”);
FJavaHelper::ToJavaStringArray() did not exist in UE 5.2, it is new in UE 5.3.
Here’s the callstack:
Assertion failed: false && “Java JNI call failed with an exception.” [File:./Runtime/Core/Private/Android/AndroidJavaEnv.cpp] [Line: 231]
D/UE : [2023.09.27-15.40.08:906][935]Assertion failed: false && “Java JNI call failed with an exception.” [File:./Runtime/Core/Private/Android/AndroidJavaEnv.cpp] [Line: 231]
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: === Critical error: ===
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: Assertion failed: false && “Java JNI call failed with an exception.” [File:./Runtime/Core/Private/Android/AndroidJavaEnv.cpp] [Line: 231]
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error:
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C8B6A89C libUnreal.so(0x0000000009F6189C)!FJavaHelper::ToJavaStringArray(_JNIEnv*, TArray<TStringView<char16_t>, TSizedDefaultAllocator<32> > const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D0089FB8 libUnreal.so(0x0000000011480FB8)!AndroidThunkCpp_Iap_BeginPurchase(TArray<TStringView<char16_t>, TSizedDefaultAllocator<32> > const&, FString const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D2EE1164 libUnreal.so(0x00000000142D8164)!FOnlinePurchaseGooglePlay::Checkout(FUniqueNetId const&, FPurchaseCheckoutRequest const&, TDelegate<void (FOnlineError const&, TSharedRef<FPurchaseReceipt, (ESPMode)1> const&), FDefaultDelegateUserPolicy> const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D027C744 libUnreal.so(0x0000000011673744)!UInAppPurchaseCheckoutCallbackProxy::TriggerCheckout(APlayerController*, FInAppPurchaseProductRequest2 const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D027BCD0 libUnreal.so(0x0000000011672CD0)!UInAppPurchaseCheckoutCallbackProxy::execCreateProxyObjectForInAppPurchaseCheckout(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C985C3C8 libUnreal.so(0x000000000AC533C8)!UObject::execCallMathFunction(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C986A1F4 libUnreal.so(0x000000000AC611F4)!UObject::execLetObj(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C985EE64 libUnreal.so(0x000000000AC55E64)!ProcessLocalScriptFunction(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C985E2E4 libUnreal.so(0x000000000AC552E4)!void ProcessScriptFunction<void ()(UObject, FFrame&, void*)>(UObject*, UFunction*, FFrame&, void*, void ()(UObject, FFrame&, void*))
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9860208 libUnreal.so(0x000000000AC57208)!ProcessLocalFunction(UObject*, UFunction*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C985EE64 libUnreal.so(0x000000000AC55E64)!ProcessLocalScriptFunction(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C985E9F8 libUnreal.so(0x000000000AC559F8)!UObject::ProcessInternal(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C95B6ACC libUnreal.so(0x000000000A9ADACC)!UFunction::Invoke(UObject*, FFrame&, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9864A48 libUnreal.so(0x000000000AC5BA48)!UObject::ProcessEvent(UFunction*, void*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C989D648 libUnreal.so(0x000000000AC94648)!void TMulticastScriptDelegate::ProcessMulticastDelegate(void*) const
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075CD85D274 libUnreal.so(0x000000000EC54274)!UButton::SlateHandleReleased()
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075CD8C07C0 libUnreal.so(0x000000000ECB77C0)!TBaseUObjectMethodDelegateInstance<false, UButton, void (), FDefaultDelegateUserPolicy>::ExecuteIfSafe() const
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C8BA848C libUnreal.so(0x0000000009F9F48C)!bool TDelegate<void (), FDefaultDelegateUserPolicy>::ExecuteIfBound<void, (void*)0>() const
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9EDC6E4 libUnreal.so(0x000000000B2D36E4)!SButton::Release()
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9EDC0F0 libUnreal.so(0x000000000B2D30F0)!SButton::OnMouseButtonUp(FGeometry const&, FPointerEvent const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9C8FD5C libUnreal.so(0x000000000B086D5C)!FSlateApplication::RoutePointerUpEvent(FWidgetPath const&, FPointerEvent const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9C5631C libUnreal.so(0x000000000B04D31C)!FSlateApplication::ProcessMouseButtonUpEvent(FPointerEvent const&)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9C98A4C libUnreal.so(0x000000000B08FA4C)!FSlateApplication::OnTouchEnded(UE::Math::TVector2 const&, int, FPlatformUserId, FInputDeviceId)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C998F35C libUnreal.so(0x000000000AD8635C)!FGenericApplicationMessageHandler::OnTouchEnded(UE::Math::TVector2 const&, int, int)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C9975C80 libUnreal.so(0x000000000AD6CC80)!FAndroidInputInterface::SendControllerEvents()
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075C99748DC libUnreal.so(0x000000000AD6B8DC)!FAndroidApplication::PollGameDeviceState(float)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D0094CD8 libUnreal.so(0x000000001148BCD8)!FEngineLoop::Tick()
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D008E600 libUnreal.so(0x0000000011485600)!AndroidMain(android_app*)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D009DB10 libUnreal.so(0x0000000011494B10)!android_main()
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x00000075D00C64C0 libUnreal.so(0x00000000114BD4C0)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x000000796E3EAE48 libc.so(0x00000000000B6E48)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error: [Callstack] 0x000000796E387458 libc.so(0x0000000000053458)
D/UE : [2023.09.27-15.40.08:907][935]LogAndroid: Error:
D/UE : [2023.09.27-15.40.08:917][935]LogExit: Executing StaticShutdownAfterError
D/UE : [2023.09.27-15.40.08:917][935]LogAndroid: FAndroidMisc::RequestExit(1, FAndroidErrorOutputDevice::Serialize.!GIsGuarded)
Do Android In-App Purchases work for anyone with UE 5.3 and Android Target SDK >=30?