[Solved] Unity IAP unable to strip and OverflowException: Value was either too large exceptions

Hello everybody,
I can’t start to implement In app purchases in the game, I’m filled with errors in the editor
Using Unity version 2020.3.15f2 with In-App Purchasing version 4.1.3. on a mac.
What could I do to fix this to start working on the store?

Thank you for reading

This is the error in the editor at the top:

UnityEditor.Build.BuildPipelineInterfaces:OnSceneProcess (UnityEngine.SceneManagement.Scene,UnityEditor.Build.Reporting.BuildReport) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:435)```

Followed with this exception:
```OverflowException: Value was either too large or too small for a character.
System.Convert.ToChar (System.Int32 value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEngine.Purchasing.MiniJSON.Json+Parser.get_PeekChar () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:335)
UnityEngine.Purchasing.MiniJSON.Json+Parser.EatWhitespace () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:324)
UnityEngine.Purchasing.MiniJSON.Json+Parser.get_NextToken () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:363)
UnityEngine.Purchasing.MiniJSON.Json+Parser.ParseValue () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:212)
UnityEngine.Purchasing.MiniJSON.Json+Parser.Parse (System.String jsonString) (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:132)
UnityEngine.Purchasing.MiniJSON.Json.Deserialize (System.String json) (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:94)
UnityEngine.Purchasing.MiniJson.JsonDecode (System.String json) (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Common/MiniJSON.cs:771)
UnityEngine.Purchasing.StoreConfiguration.Deserialize (System.String json) (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Stores/StoreConfiguration.cs:22)
UnityEngine.Purchasing.StandardPurchasingModule.Instance (UnityEngine.Purchasing.AppStore androidStore) (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Stores/StandardPurchasingModule.cs:123)
UnityEngine.Purchasing.StandardPurchasingModule.Instance () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Stores/StandardPurchasingModule.cs:103)
UnityEngine.Purchasing.CodelessIAPStoreListener.InitializePurchasing () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Codeless/CodelessIAPStoreListener.cs:55)
UnityEngine.Purchasing.CodelessIAPStoreListener.CreateCodelessIAPStoreListenerInstance () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Codeless/CodelessIAPStoreListener.cs:120)
UnityEngine.Purchasing.CodelessIAPStoreListener.InitializeCodelessPurchasingOnLoad () (at Library/PackageCache/com.unity.purchasing@4.1.3/Runtime/Codeless/CodelessIAPStoreListener.cs:49)

@Bucefalo_Games Please provide steps to reproduce on a new project. Also, avoid Codeless IAP, it has issues we need to address. I would recommend that you start with the scripted IAP sample project here Sample IAP Project

Thank you for your answer and your advice creating an empty project I could solve the problem.

This is what I did to fix the problem:

  • I deleted the folder “UnityPurchasing” with all the contents from Assets/Plugins/UnityPurchasing as the package manager suggests.
  • Because I created the IAP catalog as a Codeless IAP, Unity created “IAPProductCatalog.json” in Assets/Resources, delete it.
  • In the same folder there’s the file “BillingMode.json”. My file was blank, I took the same file from the sample the package manager provides for the corresponding version. It must show {"androidStore":"GooglePlay"} in the Inspector.

After fixing. I’m using only the scripted IAP

And you’re using Scripted IAP now correct, and not using the product catalog?

That’s correct. I’m using the scripted IAP not the product catalog in the editor.
Thank you for your advice!