Tuesday 31 December 2019

Why is Unity IAP service not working on Android production version?

Something really strange is happening to me with Unity IAP service. Purchases were working correctly until the last version of the app. When uploading the last version, the IAP buttons are not showing any data and are not clickable but nothing has changed in the code that may affect it (in fact the last version includes only minor changes on strings). The error that android studio shows is:

A scripted object (probably UnityEngine.Purchasing.IAPButton?) has a different serialization layout when loading. (Read 32 bytes but expected 624 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

But that was not happening in the immediately previous version of the app. I tried to go back to the previous version using Git but the problem persists. Also, nothing was changed recently in that script and I couldn't find any #ifdef condition.

But here is the weirdest thing: when compiling for production and installing the resulting app to a real device, there is no error! Only after uploading the resulting .aab file to the play store it starts to show the error.

Has anybody dealt with this issue?



from Why is Unity IAP service not working on Android production version?

No comments:

Post a Comment