OnPurchaseFailed is not called, Unity 2022.3.5f1+ iap4.9.3, android platform

the logcat show:
2023/07/22 00:01:05.658 25366 25366 Warn ProxyBillingActivity Activity finished with resultCode 0 and billing’s responseCode: 1
2023/07/22 00:01:05.671 25366 25366 Error Unity Exception: No such proxy method: UnityEngine.Purchasing.GooglePurchaseUpdatedListener.onPurchasesUpdated(UnityEngine.AndroidJavaObject,null)
2023/07/22 00:01:05.671 25366 25366 Error Unity
2023/07/22 00:01:05.671 25366 25366 Error Unity

Please check the attached file

9162590–1274840–IapTest.rar (1.08 MB)

3 Likes

The same problem(

Same issue here. Unity 2022.3.5f1 & IAP 4.9.3

@Arnaud_Gorain

Exception: No such proxy method:
UnityEngine.Purchasing.GooglePurchaseUpdatedListener.onPurchasesUpdated(UnityEngine.AndroidJavaObject,null)

same here

1 Like

Is there an issue on issue tracker?

I submitted a bug report (CASE IN-49151)

2 Likes

In the meantime, I managed to get it working by duplicating the purchasing package (4.9.3) and using it as a local package in which I modified GooglePurchaseUpdatedListener.cs from com.unity.purchasing@4.9.3/Runtime/Stores/Android/GooglePlay/AAR/Listeners and changed the onPurchasesUpdated method at line 53 from private to public, internal didn’t work :eyes:.

BEFORE

//com.unity.purchasing@4.9.3/Runtime/Stores/Android/GooglePlay/AAR/Listeners/GooglePurchaseUpdatedListener.cs

[Preserve]
void onPurchasesUpdated(AndroidJavaObject billingResult, AndroidJavaObject javaPurchasesList)
{
    IGoogleBillingResult result = new GoogleBillingResult(billingResult);
    var purchases = m_PurchaseBuilder.BuildPurchases(javaPurchasesList.EnumerateAndWrap()).ToList();
    OnPurchasesUpdated(result, purchases);
}

AFTER

//com.unity.purchasing@4.9.3/Runtime/Stores/Android/GooglePlay/AAR/Listeners/GooglePurchaseUpdatedListener.cs

[Preserve]
public void onPurchasesUpdated(AndroidJavaObject billingResult, AndroidJavaObject javaPurchasesList)
{
    IGoogleBillingResult result = new GoogleBillingResult(billingResult);
    var purchases = m_PurchaseBuilder.BuildPurchases(javaPurchasesList.EnumerateAndWrap()).ToList();
    OnPurchasesUpdated(result, purchases);
}
17 Likes

Hi all,
We are looking into it, stay tuned!

1 Like

Hey ageana, how do you use it as a local package? Just put inside Assets folder? I’m trying but cant compile after that

2 Likes

@EinsofInnovecs I copied the folder from <PROJECT_FOLDER>/Library/PackageCache/com.unity.purchasing@4.9.3 to <PROJECT_FOLDER>/LocalPackages/com.unity.purchasing@4.9.3 (outside of the Assets folder) and modified the entry in <PROJECT_FOLDER>/Packages/manifest.json to use the local file path

// <PROJECT_FOLDER>/Packages/manifest.json 
...
"com.unity.purchasing": "file:../LocalPackages/com.unity.purchasing@4.9.3",
...
7 Likes

Unity 2021.3.29f1+ iap4.9.3 same

4 Likes

unbelievable…:hushed:

Hey folks,
we were able to reproduce the error. I haven’t tried @ageana fix yet,
a quick look with the devs seems that this should work.

1 Like

It’s hard to understand for us how such a major error can make it’s way into a minor update used by Unity LTS.
Could you also investigate & improve your QA process for such updates?

12 Likes

same here.

Any news?

Can you please post the link for the issue tracker here so we can follow it?

I’m trying your fix to move the package to the LocalPackages and I’ll update the build and soon I get some data I will post the results here… for now, Unity should update this as SOON AS POSSIBLE!!!

Why it’s taking so long to fix it? Just a simple package update will solve this.

6 Likes

Downgrade Unity to 2021.3.16f1 to fix solve.
before i use 2021.3.29f1 then downgrade to 2021.3.

There is no issue tracker link, I think it’s only in their internal issue system.

I received a reply on Monday that they successfully reproduced the issue and it has been sent for resolution with their developer team so I guess a fix will be coming the in the following days/weeks, also I doubt that the fix for this issue will be other than mine.

2 Likes

I’ve just use your trick to copy the entire package folder, change the .cs and it works…

Unfortunately, now I’m getting the following error:

No such proxy method: UnityEngine.Purchasing.SkuDetailsResponseListener.onSkuDetailsResponse(UnityEngine.AndroidJavaObject,null)

This may be related to this file:
\com.unity.purchasing@4.9.3\Runtime\Stores\Android\GooglePlay\AAR\Listeners\SkuDetailsResponseListener.cs

Any way to solve this the same manner? The methods at SkuDetailsResponseListener.cs are internal… not private

1 Like