Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

In App Purchase Error in 2018.2.0b3 (Works in 2018.1.0f2)

Discussion in '2018.2 Beta' started by erniesbot, May 9, 2018.

  1. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Hey Guys,

    After upgrading my project to 2018.2.0b3 (to fix Physics interpolation issues) I've noticed the Unity IAP has stopped working correctly.

    To see what's been going on I've used a fresh project and installed the IAP stuff from the Services tab. When trying to make a purchase (using the example Scene) I get the following error:



    This is the same error I get in my main project.

    As a comparison I did the same on version 2018.1.0f2 and get a purchase successful message. It also works fine in Unity 2017



    When I deployed my main project to my Android device I was actually able to make the test purchase (I got a Google receipt etc) but the code that is meant to be activated upon successful purchase was not triggered ( unlocking levels in my case).

    Any ideas? I'm at a bit of a loss, I was intending to launch my game this week but this has knocked me back somewhat.

    Another developer on my team thinks it could be related to the new Package Manager perhaps?

    Advice most appreciated!


    ---------------------------------------

    Error below for more clarity...

    TypeLoadException: Could not load type 'SimpleJson.SimpleJson' from assembly 'UnityEngine.Purchasing'.
    UnityEngine.Purchasing.PurchasingManager.OnPurchaseSucceeded (System.String id, System.String receipt, System.String transactionId) (at /Users/justing/development/unity4/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:111)
    UnityEngine.Purchasing.JSONStore.OnPurchaseSucceeded (System.String id, System.String receipt, System.String transactionID)
    UnityEngine.Purchasing.FakeStore.<>n__0 (System.String id, System.String receipt, System.String transactionID)
    UnityEngine.Purchasing.FakeStore+<>c__DisplayClass15_0.<FakePurchase>b__0 (Boolean allow, PurchaseFailureReason failureReason)
    UnityEngine.Purchasing.UIFakeStore+<>c__DisplayClass14_0`1[UnityEngine.Purchasing.PurchaseFailureReason].<StartUI>b__0 (Boolean result, Int32 codeValue)
    UnityEngine.Purchasing.UIFakeStore.OkayButtonClicked ()
    UnityEngine.Purchasing.UIFakeStore.<InstantiateDialog>b__16_1 ()
    UnityEngine.Events.InvokableCall.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:166)
    UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:58)
    UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:36)
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:45)
    UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:50)
    UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
    UnityEngine.EventSystems.EventSystem:Update()
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for reporting this. I will see if I can reproduce here, and if so, I will create the appropriate tracking issue for possible inclusion in a future release. I am also checking with the IAP team to see if there might be a work around in the meantime.
     
    erniesbot likes this.
  3. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Thanks man, if there is a quick fix in the short term, I'd be super grateful.

    Cheers
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I am seeing the same thing. I will let the IAP team know.
     
    erniesbot likes this.
  5. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Any suggestions for a quick fix on this? I've had to completely remove the IAP from our game for the time being. Thanks :)
     
    Latrodectus_zeptolab likes this.
  6. Yanka33

    Yanka33

    Joined:
    Oct 12, 2015
    Posts:
    10
    Any news about this issue? I still experience it on Unity 2018.2.0b4 with IAP 2.0.0
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The SimpleJson issue is currently being investigated by the IAP team. It should be addressed in the next release, no ETA at this time but hopefully very soon.
     
  8. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Thanks for the update Jeff
     
  9. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    same here, using b6 i can't build for UWP using IAP
    error:
    Reference rewriter: Error: type `SimpleJson.SimpleJson` doesn't exist in target framework. It is referenced from UnityEngine.Purchasing.dll at System.String UnityEngine.Purchasing.PurchasingManager::FormatUnifiedReceipt(System.String,System.String).
    UnityEngine.Debug:LogError(Object)
     
  10. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Any update on this issue? :)
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm that this is only happening in the Editor, and not on a device?
     
  12. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @erniesbot, @creat327, @Yanka33

    This SimpleJson bug was fixed in the latest version (2.0.3) of the "In App Purchasing" package in the Package Manager. (This is separate from the Unity IAP plugin downloaded from the Services window or Asset Store.)

    If you are using Codeless IAP, there is a known issue in 1.19 of the Unity IAP plugin. It will only affect Codeless IAP in the Editor. It does not affect devices. More details here:
    https://forum.unity.com/threads/arg...-an-empty-or-null-string.532108/#post-3531211
     
  13. erniesbot

    erniesbot

    Joined:
    Feb 24, 2016
    Posts:
    15
    Hey thanks for this, I'll check it out!