Hi
According to the callstack, It happens not in init or purchase.
I check user’s subsricption infomation every hour in OnApplicationPause when pause is false, in case user’s subscription changed.
it should happened when I query the subscription info.
Does your app crash when this happens? Otherwise, you’ll need to ensure that your products are available. Please provide the device logs, they will provide more information as to why the products are not available. How To - Capturing Device Logs on Android
12-06 13:31:13.338: E/Unity(15994): NullReferenceException: Object reference not set to an instance of an object.
12-06 13:31:13.338: E/Unity(15994): at UnityEngine.Purchasing.Models.GooglePurchaseResult.FillPurchases (UnityEngine.AndroidJavaObject purchaseResult, Stores.IGoogleCachedQuerySkuDetailsService cachedQuerySkuDetailsService) [0x00000] in <00000000000000000000000000000000>:0
12-06 13:31:13.338: E/Unity(15994): at UnityEngine.Purchasing.GoogleQueryPurchasesService.QueryPurchasesWithSkuType (System.String skuType) [0x00000] in <00000000000000000000000000000000>:0
12-06 13:31:13.338: E/Unity(15994): at UnityEngine.Purchasing.GoogleQueryPurchasesService.QueryPurchases (System.Action`1[T] onQueryPurchaseSucceed) [0x00000] in <00000000000000000000000000000000>:0
12-06 13:31:13.338: E/Unity(15994): at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
12-06 13:31:13.338: E/Unity(15994): at UnityEngine.Purchasing.QuerySkuDetailsService.ConsolidateOnSkuDetailsReceived (UnityEngine.AndroidJavaObject javaBillingResult, UnityEngine.AndroidJavaObject skuDetails, System.Action`1[T] onSkuDe
Non-fatal Exception: java.lang.Exception: NullReferenceException : Object reference not set to an instance of an object.
at UnityEngine.Purchasing.Models.GooglePurchaseResult.FillPurchases(UnityEngine.Purchasing.Models.GooglePurchaseResult)
at UnityEngine.Purchasing.GoogleQueryPurchasesService.QueryPurchasesWithSkuType(UnityEngine.Purchasing.GoogleQueryPurchasesService)
at UnityEngine.Purchasing.GoogleQueryPurchasesService.QueryPurchases(UnityEngine.Purchasing.GoogleQueryPurchasesService)
at System.Action1[T].Invoke(System.Action1[T])
at UnityEngine.Purchasing.Extension.UnityUtil.OnApplicationPause(UnityEngine.Purchasing.Extension.UnityUtil)
#2
Non-fatal Exception: java.lang.Exception: NullReferenceException : Object reference not set to an instance of an object.
at UnityEngine.Purchasing.Models.GooglePurchaseResult.FillPurchases(UnityEngine.Purchasing.Models.GooglePurchaseResult)
at UnityEngine.Purchasing.GoogleQueryPurchasesService.QueryPurchasesWithSkuType(UnityEngine.Purchasing.GoogleQueryPurchasesService)
at UnityEngine.Purchasing.GoogleQueryPurchasesService+<>c__DisplayClass3_0.b__0(UnityEngine.Purchasing.GoogleQueryPurchasesService+<>c__DisplayClass3_0)
at System.Action1[T].Invoke(System.Action1[T])
at System.Action1[T].Invoke(System.Action1[T])
at UnityEngine.Purchasing.Extension.UnityUtil.OnApplicationPause(UnityEngine.Purchasing.Extension.UnityUtil)
Unfortunately there is no action we could take in that case. You would want to look for any specifics around the crash reports, like the same phone type, country, etc. Otherwise you’ll want to publish with Unity 2.2.4 (or the most current version, they are coming out fast) and see if it helps.
The problem started appearing in crashlytics when I upgraded the unity package from 2.1.1 to 2.2.0.
The current build is live with version 2.2.4. It still happens.
Thinking about reverting back.
Please let us know if you find out any additional details from the crash reports, as mentioned. Previous releases are here https://discussions.unity.com/t/632966
Hi,
We have the same problem - 20+ cases on Crashlytics (android, different devices, different android versions, Unity IAP 2.2.4). Problem starts from 2.2.x (version 2.1.1 was ok).
Jeff, I have a project where I can stably reproduce this case. I’d like to strip down all assets/code, pack it and send it to you. Should I use PM here or would you like me to send it via e-mail?
Just the written steps should suffice, otherwise I recommend that we always test with the Sample IAP Project here so we are on the same page https://discussions.unity.com/t/700293
I received the logs, but I need steps to reproduce, thanks. I do see “Please provide a valid SKU type” in the logs. What’s different between your project and the Sample project? Please test with IAP 2.2.4