IAP bool UnityEngine.VR.VRSettings.get_enabled() error

I’m using 2019.1.0b6 and I have deleted channel and purchasing folder in plugin folder and reimported.But i get some error on api upgrade
(Assertion failed on expression: ‘!performAutorepaint || GetApplication().MayUpdate()’
UnityEditor.Purchasing.UnityIAPInstaller:Install())
and second error
NullReferenceException: Object reference not set to an instance of an object
UnityEditorInternal.APIUpdating.APIUpdaterManager.UpdateDependencyGraph (System.Collections.Generic.IEnumerable`1[T] addedAssemblyPaths) (at C:/buildslave/unity/build/Editor/Mono/Scripting/APIUpdater/APIUpdaterManager.bindings.cs:580)
UnityEditorInternal.APIUpdating.APIUpdaterManager.ProcessImportedAssemblies (System.String[ ] assemblies) (at C:/buildslave/unity/build/Editor/Mono/Scripting/APIUpdater/APIUpdaterManager.bindings.cs:334)

and in logcat the error is below. This is the first time i implement this package.And i activated my bank account.

2019-03-09 00:33:27.813 28771-28793/? I/Unity: Purchasing product asychronously: ‘1dollar’

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
2019-03-09 00:33:27.851 28771-28793/? E/Unity: MissingMethodException: bool UnityEngine.VR.VRSettings.get_enabled()
at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00129] in :0
at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x0003c] in :0
at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product) [0x00000] in :0
at Purchaser.BuyProductID (System.String productId) [0x0003e] in <0b034c2f00744ade85d32195db358732>:0
at Purchaser.BuyConsumable () [0x00000] in <0b034c2f00744ade85d32195db358732>:0
at UnityEngine.Events.InvokableCall.Invoke () [0x00011] in <18283f6f53974baab94f3a93a7715e44>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00023] in <18283f6f53974baab94f3a93a7715e44>:0
at UnityEngine.UI.Button.Press () [0x00027] in

In today update it crashes every time that i reimport or reinstall. Editor log shows that error
Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs Line: 362
I sent bug report Case 1135234

Likely not a bug. Please test with a new project. Also, this may help: IAP Troubleshooting - Remove and Reinstall Unity IAP

First of all i have full access to folder. It is in documents and i’m administrator.
I tried the instructions in topic which you sent at least 10 times and all of them give error same that
i wrote in first message (Assertion failed on expression: ‘!performAutorepaint || GetApplication().MayUpdate()’
UnityEditor.Purchasing.UnityIAPInstaller:Install())

Here is a video to show

After this part in build version logcat give error when trying to buy
2019-03-09 00:33:27.813 28771-28793/? I/Unity: Purchasing product asychronously: ‘1dollar’
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
2019-03-09 00:33:27.851 28771-28793/? E/Unity: MissingMethodException: bool UnityEngine.VR.VRSettings.get_enabled()
at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00129] in :0
at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x0003c] in :0
at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product) [0x00000] in :0
at Purchaser.BuyProductID (System.String productId) [0x0003e] in <0b034c2f00744ade85d32195db358732>:0
at Purchaser.BuyConsumable () [0x00000] in <0b034c2f00744ade85d32195db358732>:0
at UnityEngine.Events.InvokableCall.Invoke () [0x00011] in <18283f6f53974baab94f3a93a7715e44>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00023] in <18283f6f53974baab94f3a93a7715e44>:0
at UnityEngine.UI.Button.Press () [0x00027] in

I tried new project and it doesn’t give error so how should i fix my project?
And what is the problem? Maybe Google Play Services Plugin or Monetization?

Again, try with a brand new, EMPTY project. Your video is not of an empty project. And what did you do differently each of the 10 times where you expected a different result? I would need to know what you tried so as to not waste your time further. Please try opening the Sample project here, the video shows the import process Sample IAP Project

It works in empty project i typed in last message if you read to the end. So i’m asking how can i fix my project

You will need to find any differences between the two projects. You had answered your own question regarding packages you can try. Something looks to be prohibiting the API updater from running. There can be no compiler errors during the import process, or it will fail. You are getting hundreds.

I tried to remove some packages and import but still not working or couldn’t find the reason behind this. But without iap i don’t get any error in compile. I will try to find the reason

You have an editor Save All script that I would remove first, I suspect that is the issue. You look to be saving the ConnectSettings.Asset file which would likely be unexpected to our installer and is read to determine the UNITY_PURCHASING directive. Also, instead of “Removing” packages, I would recommend Adding them to an empty project first, and work up that way.

1 Like

Ok man i found thanks to you. In preferences, i disabled verify saving assets in general settings and it works now

Lol i thought that will work but it only hides error. Still same. Should i open empty project and copy my all things to it? And couldnt new package be released for new api? Because it is the only package that i couldn’t get it work. And the most important. I have been trying to solve for 5 days but couldn’t do anything because of old api vr to xr code. I don’t know why api updater can’t handle this. Clicking save all button in empty project doesn’t cause any error . I have these in my packages window.
Analytics Library
Core RP Library
In App Purchasing
Lightweight RP
Mobile Notifications
Package Manager UI
Post Processing
Shader Graph
TextMesh Pro
Unity Timeline

And these are extra packages from asset store or github.
Play Games Plugin For Unity(Github)
Monetization(Asset Store)

I think for now i will just work on other things and will wait until exact solution.
As you see i did what you say in reimporting iap topic in video. Exactly same steps. But i spent enough time and couln’t find what is confronting or where is problem.

Please elaborate, “hides the error”. Are you still getting the VR.VRSettings error? When you import IAP, you must be sure that you don’t receive any compile errors during the import.

And the error i think is this .I got this only when reimporting all packages except iap(when purchasing and channel folder are deleted)

Assertion failed on expression: ‘0 == m_CurrentBuiltInBindMask’
UnityEditor.AssetPreviewUpdater:CreatePreviewForAsset(Object, Object[ ], String)

I get these errors only importing iap package.

Assertion failed on expression: ‘!performAutorepaint || GetApplication().MayUpdate()’
UnityEditor.Purchasing.UnityIAPInstaller:Install()

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.SceneView.CallOnPreSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3318)
UnityEditor.SceneView.DoOnPreSceneGUICallbacks (UnityEngine.Rect cameraRect) (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1919)
UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2303)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <375bbb845b2b437f959e638c1c4f2e9a>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <375bbb845b2b437f959e638c1c4f2e9a>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at <375bbb845b2b437f959e638c1c4f2e9a>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:344)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:338)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:312)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:373)
UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:340)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:275)
UnityEditor.Purchasing.UnityIAPInstaller:Install()

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
UnityEditor.Purchasing.UnityIAPInstaller:Install()

There can be no compiler errors during the import process or the API update cannot run. Once you delete the Purchasing and Channel folders prior to import, the game must compile first. Then you import IAP. I agree the code sounds like internal Unity code, but unfortunately, without specific steps to reproduce, there isn’t any action we can take. Are you running any Editor scripts by chance? Perhaps one other package, along with IAP, is causing the issue. Unfortunately only trial and error might work to determine which one.

After i delete purchasing and channel folder there is no error after it compiles Here is compile result after deleting.
I don’t use any script that change editor. Maybe it is 2019.1.0b7 editor scripts that confront idk.

After this i click import and the errors appear. I’m from Turkey. Could that affect this? Maybe connection settings or timezone? But it works in empty project Ok i will try one by one adding

I think i found the reason is mobile notification package. It happens after that i installed it in empty project. Yeah i’m sure it is. After i deleted it and editor folder that save notification asset no errors occur. Thank you Jeff i should have done this early but i didn’t want to deal with :slight_smile: But you can contact the team who prepares notification package. It’s assets in editor folder confront your packages. And notification package gives error when first importing. I will try their packages other versions maybe they won’t make problem. If i can find working version of notification package with iap package or i will implement iap package first and after it compiles i will try to add notification package. I will inform you and i’m writing bug report now.
And these are the errors when importing notification preview.10

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UIElements.StyleSheets.StyleSelectorHelper.FastLookup (System.Collections.Generic.IDictionary2[TKey,TValue] table, System.Collections.Generic.List1[T] matchedSelectors, UnityEngine.UIElements.StyleMatchingContext context, System.String input, UnityEngine.UIElements.StyleSheets.SelectorMatchRecord& record) (at C:/buildslave/unity/build/Modules/UIElements/StyleSheets/StyleSelectorHelper.cs:206)
UnityEngine.UIElements.StyleSheets.StyleSelectorHelper.FindMatches (UnityEngine.UIElements.StyleMatchingContext context, System.Collections.Generic.List`1[T] matchedSelectors) (at C:/buildslave/unity/build/Modules/UIElements/StyleSheets/StyleSelectorHelper.cs:233)
UnityEngine.UIElements.VisualTreeStyleUpdaterTraversal.TraverseRecursive (UnityEngine.UIElements.VisualElement element, System.Int32 depth) (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeStyleUpdater.cs:246)
UnityEngine.UIElements.StyleSheets.HierarchyTraversal.Recurse (UnityEngine.UIElements.VisualElement element, System.Int32 depth) (at C:/buildslave/unity/build/Modules/UIElements/HierarchyTraversal.cs:24)
UnityEngine.UIElements.VisualTreeStyleUpdaterTraversal.TraverseRecursive (UnityEngine.UIElements.VisualElement element, System.Int32 depth) (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeStyleUpdater.cs:271)
UnityEngine.UIElements.StyleSheets.HierarchyTraversal.Traverse (UnityEngine.UIElements.VisualElement element) (at C:/buildslave/unity/build/Modules/UIElements/HierarchyTraversal.cs:11)
UnityEngine.UIElements.VisualTreeStyleUpdater.ApplyStyles () (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeStyleUpdater.cs:123)
UnityEngine.UIElements.VisualTreeStyleUpdater.Update () (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeStyleUpdater.cs:106)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTree () (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeUpdater.cs:70)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:589)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:230)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
UnityEditor.AssetDatabase:SaveAssets()
Unity.Notifications.UnityNotificationEditorManager:Initialize() (at Library/PackageCache/com.unity.mobile.notifications@1.0.0-preview.10/Editor/UnityNotificationEditorManager.cs:275)
Unity.Notifications.UnityNotificationEditorManager:OnProjectLoaded() (at Library/PackageCache/com.unity.mobile.notifications@1.0.0-preview.10/Editor/UnityNotificationEditorManager.cs:255)

and

Assertion failed on expression: ‘!performAutorepaint || GetApplication().MayUpdate()’
UnityEditor.AssetDatabase:SaveAssets()
Unity.Notifications.UnityNotificationEditorManager:Initialize() (at Library/PackageCache/com.unity.mobile.notifications@1.0.0-preview.10/Editor/Unity
NotificationEditorManager.cs:275)
Unity.Notifications.UnityNotificationEditorManager:OnProjectLoaded() (at Library/PackageCache/com.unity.mobile.notifications@1.0.0-preview.10/Editor/UnityNotificationEditorManager.cs:255)

Glad you found the issue! I will let the team know here too.

But i still get MissingMethodException: bool UnityEngine.VR.VRSettings.get_enabled() when trying to buy in logcat.
I’m really tired :slight_smile: API Updater Panel doesn’t pop-up. I don’t know why it doesn’t work. I tried to integrate old api code like this.animation.Play() and it could make api updater work but only for that script(I tried on playstore). It doesn’t ask me after importing iap to update api.I tried on new project and it doesn’t pop up in that too. I have read old topics about this and did whatever the solution they and you said to run api updater but i can’t find

Same here. The “update API” prompt never shows up and I’m always getting the MissingMethodException when I try to make a purchase. There are no compilation errors. Also tried it in a brand new project, only enabling the In-app purchase service - the problem was still there. I’m using Unity 2019.1b7 btw.
Any other suggestions how to bypass this exception? Maybe a link to an updated package?