ArgumentException: Cannot set currency to an empty or null string

I’m getting ‘ArgumentException: Cannot set currency to an empty or null string’ trying to implement codeless IAP.

It looks like I’ve just forgotten to complete a currency somewhere, but I can’t seem to find it. Anyone seen this anywhere?

I’m using Unity 2018.1.0f2 if it matters.

Full error text

ArgumentException: Cannot set currency to an empty or null string
UnityEngine.Analytics.Analytics.Transaction (System.String productId, Decimal amount, System.String currency, System.String receiptPurchaseData, System.String signature, Boolean usingIAPService) (at C:/buildslave/unity/build/Modules/UnityAnalytics/UnityAnalytics.cs:134)
UnityEngine.Purchasing.UnityAnalytics.Transaction (System.String productId, Decimal price, System.String currency, System.String receipt, System.String signature) (at /Users/stevenb/unity-src3/Extensions/UnityPurchasing/Runtime/Purchasing/UnityAnalytics.cs:14)
UnityEngine.Purchasing.AnalyticsReporter.OnPurchaseSucceeded (UnityEngine.Purchasing.Product product) (at /Users/stevenb/unity-src3/Extensions/UnityPurchasing/Runtime/Purchasing/AnalyticsReporter.cs:27)
UnityEngine.Purchasing.StoreListenerProxy.ProcessPurchase (UnityEngine.Purchasing.PurchaseEventArgs e) (at /Users/stevenb/unity-src3/Extensions/UnityPurchasing/Runtime/Purchasing/StoreListenerProxy.cs:33)
UnityEngine.Purchasing.PurchasingManager.ProcessPurchaseIfNew (UnityEngine.Purchasing.Product product) (at /Users/stevenb/unity-src3/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:211)
UnityEngine.Purchasing.PurchasingManager.OnPurchaseSucceeded (System.String id, System.String receipt, System.String transactionId) (at /Users/stevenb/unity-src3/Extensions/UnityPurchasing/Runtime/Purchasing/PurchasingManager.cs:115)
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.b__0 (Boolean allow, PurchaseFailureReason failureReason)
UnityEngine.Purchasing.UIFakeStore+<>c__DisplayClass14_01[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.EventFunction1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update()

The same for me. I got this on the working project after updating to 2018.1.

1 Like

@Kiwasi , @bryukh

It looks like this bug has been reported and reproduced by the QA team. Here is the Issue Tracker link:

I will also mention it to the IAP team and hopefully it should be addressed in a future version of the plug-in.

1 Like

@ap-unity

When could we expect the future version release?

Thanks. I’ll work in another direction for now, and hopefully the bug is resolved the next time I cycle back to IAP.

1 Like

How to fix it?

@phpnato Unfortunately I’m still seeing the exception in IAP 1.19, so you would need to wait for the next release. Is it preventing the purchase to complete on the device for you?

Yes. There is an error while purchasing.

@phpnato Understood, the IAP team is working on it, no ETA yet but I will keep this thread updated.

As I understand it, the purchase succeeds, and then we get an exception while trying to send this event to Analytics:

Are those purchase registered or they fail?

I’ve reverted to 2017.4. Unless you need a new feature, this seems to be the best fix.

the same problem with working project. is it possible to solve the problem with 2018.1.f1 or the only way is to go back to old version?

Please see my post from May 23, we are working on a resolution.

Thank you

Almost two weeks later and the bug still isn’t fixed. A bug that any decent QA should’ve been able to catch. Things like this are why my company wants to move to other game engines - Unity just feels like it’s in perpetual beta.

1 Like

The fix is currently going through QA, we want to make sure it properly addresses the issue. Our test matrix with various store platforms, device platforms and Unity versions is quite large, and takes time.

Still no fix for this?

We are working on this issue at highest priority. I personally ensured yesterday that this is the first issue to be addressed. We are currently scheduling the fix into the release cycle.

1 Like

Thank you.