When changing the target store in the Editor.
Unity 2017.1.0p3
Edit: This crashes the Editor.
StackOverflowException: The requested operation caused a stack overflow.
UnityEngine.Purchasing.UnityPurchasingEditor.TargetAndroidStore (AndroidStore target)
UnityEngine.Purchasing.UnityPurchasingEditor.TargetAndroidStore (AndroidStore target)
UnityEngine.Purchasing.UnityPurchasingEditor.TargetAndroidStore (AndroidStore target)
UnityEngine.Purchasing.UnityPurchasingEditor.TargetAndroidStore (AndroidStore target)
I have a post process script that runs when building, it changes the store and thus crashes every time it’s run.
Does it crash when you are not using your script? If so, please provide steps to reproduce. This is not an error we are familiar with. Was it working OK with a previous version of Unity?
No only when using the script. The Unity version has not changed, only IAP version. Worked fine before.
A blank project with the following code will crash:
[DidReloadScripts]
public static void OnPostprocessScene()
{
#if UNITY_ANDROID
#if AMAZON
Debug.LogWarning("OnPostprocessScene - TARGET AMAZON");
UnityPurchasingEditor.TargetAndroidStore(AndroidStore.AmazonAppStore);
#else
Debug.LogWarning("OnPostprocessScene - TARGET GOOGLEPLAY");
UnityPurchasingEditor.TargetAndroidStore(AndroidStore.GooglePlay);
#endif
}
I assume you are purposely not including the matching #endif for #if UNITY_ANDROID, or mistyped? We would need to take a look at the script so we could attempt to reproduce here. If you could, please open a support ticket at Unity Cloud
Also, I should add that the AndroidStore enum was removed in 1.13. It was replaced by the AppStore enum. It’s mentioned in the changelog and here:
Unity IAP - Purchasing SDK Updates Unity Services Window: Users can install and update in the Cloud Services window, under In-App Purchasing, by pressing the ‘Import’ or ‘Update’ button. Asset Store: Unity IAP is now also available on the Asset...
Reading time: 40 mins 🕑
Likes: 227 ❤
Yeah the ifdef was just cut off when i copy/pasted.
It seems changing the enum fixed the error, so its something to do with using the old enum.
This problem should be resolved in the latest version of the IAP plugin: 1.13.1
Unity IAP - Purchasing SDK Updates Unity Services Window: Users can install and update in the Cloud Services window, under In-App Purchasing, by pressing the ‘Import’ or ‘Update’ button. Asset Store: Unity IAP is now also available on the Asset...
Reading time: 40 mins 🕑
Likes: 227 ❤