Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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

Discussion in 'Unity IAP' started by densy07, Jul 21, 2023.

Thread Status:
Not open for further replies.
  1. abbabon

    abbabon

    Joined:
    Mar 19, 2018
    Posts:
    5
    Thank you! You are the real MVP
     
  2. jinn97

    jinn97

    Joined:
    Oct 22, 2020
    Posts:
    23
    With this fix, the issue is that on Project Settings, InAppPurchasing, the Google Monetization KEY will always be removed and an error will show on top. Has anyone fixed this?

    Also, has anyone tested on 2021.3.30f1 with IAP 4.9.4?
    Thank you!
     
    Last edited: Sep 2, 2023
  3. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    84
    Great news! A fix for this specific issue is on the way and will be available soon. You can keep track of its progress as it gets merged into the various Unity versions on our issue tracker.

    → Link to issue tracker (UUM-44752)
     
  4. joe_nk

    joe_nk

    Joined:
    Jan 6, 2017
    Posts:
    67
    Good news, thanks for the update. I'm assuming since this is an engine update the problem goes much deeper than expected? Has the code stripper been changed to only honour the
    PreserveAttribute
    for public methods?

    Should we be looking at where else this bug might be affecting us with regards to the use of
    [Preserve]
    in our own code/libraries?
     
  5. clonegamedev

    clonegamedev

    Joined:
    Mar 30, 2020
    Posts:
    1
    I don't know if this is related but I am experiencing a similar issue. When native android purchasing interface is dismissed without purchase, OnPurchaseFailed is not fired. On iOS, when the same action is performed, OnPurchaseFailed is fired with UserCanceled.
     
  6. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    84
    hey @joe_nk, you are right, this is an engine issue that was introduced after another fix (UUM-30243)
    . The issue itself appears when you want to access a private method using AndroidJavaObjects, and as I said previously, there is already a fix for it and will be included in the upcoming releases for the different Unity versions (
    2021.3.31f1
    ,
    2022.3.10f1
    ,
    2023.1.13f1
    ,
    2023.2.0b9
    and
    2023.3.0a1
    ).
     
    tessellation likes this.
  7. jinn97

    jinn97

    Joined:
    Oct 22, 2020
    Posts:
    23
    @manugil what about the issue with Monetization key?
    upload_2023-9-5_14-27-39.png

    JSONParseException: Cannot parse json value starting with '<!doc' at line 1, column 1
    UnityEditorInternal.JSONParser.ParseValue () (at <4f41070b52224a70bdc90f923c6b37de>:0)
    UnityEditorInternal.JSONParser.Parse () (at <4f41070b52224a70bdc90f923c6b37de>:0)
    UnityEditor.Connect.PurchasingProjectSettings+EnabledState.OnGetGooglePlayKey (UnityEngine.AsyncOperation op) (at <f7bd9488bc484ab898db17c20a9f9466>:0)
    UnityEngine.AsyncOperation:InvokeCompletionEvent()

    upload_2023-9-5_14-28-8.png

    If you set it, it will update and remove the error, but if you change into another GameObject inspector and come back, it will reset and show the error again
     
  8. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    84
    It doesn't seem to be the same issue as the one being discussed in this thread. If you are facing any blockers please feel free to report the bug and we will look into it.
     
  9. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Can this please be rolled out? Google is requiring billing library v5 by the end of this month, yet the latest Unity LTS IAP doesn't work.

    Thank you
     
    NorthStar79 likes this.
  10. NorthStar79

    NorthStar79

    Joined:
    May 8, 2015
    Posts:
    88
    As stated in the issue tracker, this bug fix rolls out with version 2022.3.10f1
    But as @breban1 stated,
    Google is requiring billing library v5 by the end of this month

    We need this fix to rollout as soon as possible, since we live in the stores and testing and releasing a new version of games takes a considerable amount of time.
    @manugil can you help us with that?
     
  11. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    84
    The bug fix is scheduled to roll out with version 2022.3.10f1, which is expected to be released between Wednesday, September 20th, and Friday, September 22nd.

    However, if you can't wait, the only solution is to roll back to the previous Unity version that doesn't have the issue 2022.3.4f.
     
    Last edited: Sep 21, 2023
    ViliamVolosV and NorthStar79 like this.
  12. bekici

    bekici

    Joined:
    Nov 1, 2018
    Posts:
    14
    Hi @manugil
    When will 2021.3.31f1 be released?
     
  13. ViliamVolosV

    ViliamVolosV

    Joined:
    Feb 12, 2013
    Posts:
    19
    Hi @manugil
    When will 2021.3.31f1 be released?
     
    jmozgawa, bekici and Shefich like this.
  14. mfdgames

    mfdgames

    Joined:
    Oct 16, 2019
    Posts:
    1
    Hi @manugil
    When will 2021.3.31f1 be released?
     
    jmozgawa and bekici like this.
  15. AndyBlock

    AndyBlock

    Joined:
    Oct 12, 2016
    Posts:
    35
    Hi @manugil,

    We also are eagerly awaiting news of 2021.3.31f1, as this is currently blocking our next update. Can you give any info about the ETA on that? I see the 2022.3.10f1 dropped already a couple of days ago... thanks in advance,

    Andy

    (tagging @Arnaud_Gorain @SebT_Unity also, in case @manugil is not around?)
     
    ViliamVolosV and bekici like this.
  16. VitasM

    VitasM

    Joined:
    Oct 3, 2015
    Posts:
    1
    Hi @manugil
    When will 2021.3.31f1 be released?
     
  17. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    84
    2021.3 release follows a 1-month cadence. 2021.3.31f1 is expected to be released on October 4th.

    If this is blocking your development, please use 2021.3.28f1 in the meantime, as the bug should not be present in that release.
     
    Last edited: Sep 21, 2023
    AndyBlock likes this.
  18. jpons_unity

    jpons_unity

    Joined:
    May 26, 2022
    Posts:
    2
    The bug is not solved.

    Yes, on 2022.3.10f1 failures are notified. True. Deferred or pending (whatever name you want to use)... not.

    And to manage them is also mandatory, in google
     
  19. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi, I released an app update yesterday using Unity 2021.3.30f1 and I start to see the following errors in Cloud Diagnostics:
    Code (CSharp):
    1.  
    2. Exception: No such proxy method: UnityEngine.Purchasing.GooglePurchaseUpdatedListener.onPurchasesUpdated(UnityEngine.AndroidJavaObject,null)
    But it seems that the payments still works...
    I wanted to know what problems this error will produce ? In which case payments will not work ?
     
  20. jinn97

    jinn97

    Joined:
    Oct 22, 2020
    Posts:
    23
    The update is now available, but the issue is still not fixed.
     
  21. kayisoftDev

    kayisoftDev

    Joined:
    Jun 11, 2019
    Posts:
    8
    Yes, I've been waiting for Unity 2021.3.31 for more than 20 days
    The update is available now, so I've updated unity version, but the issue is still not fixed

    (Note, a newer version of `In App Purchasing` package is still not available, so I've tested with 4.9.4)
     
    Last edited: Oct 5, 2023
  22. jawnwee

    jawnwee

    Joined:
    Nov 4, 2019
    Posts:
    33
    @jinn97 where are you seeing the update? I haven't found any updates available on my end
     
  23. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Just updated to 2022.3.10f1 and the issue is still there.
     
  24. kayisoftDev

    kayisoftDev

    Joined:
    Jun 11, 2019
    Posts:
    8
  25. ImmortalWeeds

    ImmortalWeeds

    Joined:
    Oct 6, 2022
    Posts:
    1
    Hi guys, I tried it with my friend and succeeded in resolving this problem using link.xml.

    Firstly, you should know the full name of the assembly, namespace, class, function, parameters, and return type.

    Code (CSharp):
    1. static void Main()
    2.     {
    3.         string className = "NamespaceName.ClassName"; // Replace with the fully-qualified name of the class.
    4.         string methodName = "MethodName"; // Replace with the name of the private method you want to retrieve.
    5.         Type[] parameterTypes = new Type[] { typeof(int), typeof(string) }; // Replace with the types of the method's parameters.
    6.  
    7.         try
    8.         {
    9.             // Attempt to load the assembly containing the class by its name.
    10.             Assembly assembly = Assembly.Load("AssemblyName"); // Replace with the name of the assembly containing the class.
    11.  
    12.             if (assembly != null)
    13.             {
    14.                 // Attempt to get the type (class) by its name.
    15.                 Type type = assembly.GetType(className);
    16.  
    17.                 if (type != null)
    18.                 {
    19.                     // Attempt to get the private method by its name and parameter types.
    20.                     MethodInfo method = type.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance, null, parameterTypes, null);
    21.  
    22.                     if (method != null)
    23.                     {
    24.                         // Get the qualified name of the private method.
    25.                         string qualifiedMethodName = $"{type.FullName}.{method.Name}";
    26.                         Console.WriteLine("Qualified Method Name: " + qualifiedMethodName);
    27.                     }
    28.                     else
    29.                     {
    30.                         Console.WriteLine("Private method not found in the class.");
    31.                     }
    32.                 }
    33.                 else
    34.                 {
    35.                     Console.WriteLine("Class not found in the assembly.");
    36.                 }
    37.             }
    38.             else
    39.             {
    40.                 Console.WriteLine("Assembly not found.");
    41.             }
    42.         }
    43.         catch (Exception ex)
    44.         {
    45.             Console.WriteLine("Error: " + ex.Message);
    46.         }
    47.     }
    Secondly, we apply it in the link.xml

    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="UnityEngine.Purchasing.Stores, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
    3.         <type fullname="UnityEngine.Purchasing.GooglePurchaseUpdatedListener">
    4.             <method signature="System.Void onPurchasesUpdated(UnityEngine.AndroidJavaObject,UnityEngine.AndroidJavaObject)"/>
    5.         </type>
    6.     </assembly>
    7. </linker>
     
    thang_unity516 likes this.
  26. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    43
    This one works for me now on Unity 2022.3.6f1. Instead of turning IAP package into local, this works for all method including private ones. I used it to fix "OnPurchasedFailed is not call" when I cancel the transaction in the GooglePlay popup

    Thanks for your help
     
  27. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    43
    I did test on Unity 2021.3.28f1 using this method and it works fine when canceled transaction. But if I test on 2021.3.30f1 with the similar case, there is no error callback
     
  28. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi, in the 2021.3.31f1 release notes the bug is in the fixed section, but in the issue tracker it seems to be in review for 2021.3.31f1 version. Is the bug fixed or not in this version ?
     
  29. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    43
    Unity IAP (4.9.10 - mistype) 4.10.0 has this bug fixed. My team tests on Unity 2022.3.6f1 with android device and works fine for now
     
    Last edited: Nov 1, 2023
    SebT_Unity likes this.
  30. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Unity IAP 4.9.10 or 4.10.0?
     
  31. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    184
  32. thang_unity516

    thang_unity516

    Joined:
    Oct 29, 2021
    Posts:
    43
    My bad. It's 4.10.0. Edited in the old comment. Thanks for correct me
     
  33. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    158
    Same error: Unity 2021.3.31f1 + iap4.9.4, android platform
     
  34. GoGames

    GoGames

    Joined:
    Apr 8, 2015
    Posts:
    28
    Has this been sorted now?
     
  35. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    184
Thread Status:
Not open for further replies.