Okay, this is kinda a weird issue, but for some reason Amazon's IAP SDK is trying to create a monobehaviour in a constructor... This causes errors when i build it...
This is the code in question...
private AmazonIapV2Impl() {}
public static IAmazonIapV2 Instance {
get
{
return Builder.instance;
}
}
private class Builder
{
// A static constructor tells the C# compiler not to mark type as beforefieldinit, and thus lazy load this class
static Builder() {}
internal static readonly IAmazonIapV2 instance =
#if UNITY_EDITOR
new AmazonIapV2UnityEditor();
#elif UNITY_ANDROID
AmazonIapV2UnityAndroid.Instance;
#elif __ANDROID__
AmazonIapV2Android.Instance;
#else
new AmazonIapV2Default();
#endif
}
You can see in editor it creates a new AmazonIapV2UnityEditor and it seems when i build it to the Amazon firestick it's calling the else new AmazonIapV2Default();? I never altered these classes, it's strange that Amazon seemingly released this SDK with bugs? lol
Does anyone know how to fix this? I tried altering the code and removing the monobehavior, but that makes other parts break.
Thanks
↧