Search Unity

Exception: Error: called non-existent method System.Boolean UnityEngine.VR.VRSettings::get_enabled(

Discussion in 'Unity IAP' started by Antony-Blackett, Feb 22, 2018.

  1. brayang

    brayang

    Joined:
    Jan 4, 2016
    Posts:
    4
    Hello. When checking in-app purchase on a real device, I have an error the same :
    Exception: Error: called non-existent method System.Boolean UnityEngine.VR.VRSettings::get_enabled()
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.VR.VRSettings.get_enabled () [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase (System.String productJSON, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at ItemComboPacketDetail.BuyItem () [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    05-27 16:50:27.065 26630 26703 E Unity : at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0


    --------------- Unity version : 2019.1.4f1-------------------
     
    AdrianoVerona_Unity likes this.
  2. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    Hi, have you seem this message ?

    https://forum.unity.com/threads/exc...ttings-get_enabled.518868/page-2#post-4517053

    Adriano
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    Before you import IAP, there can be no compiler errors. If you are reinstalling and delete the old version first, you MUST make sure that the project still compiles. You'll need to remove all Purchasing references, prior to import. Please compare to a brand new/empty project, and import IAP (only). You should see the prompt.
     
  4. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    I don't have compiler errors! This error occurs when you click on the purchase button when checking the application on a real device. (I see it in the log, the application does not crash. The error is displayed in the method: BuyProductID)
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    I meant compiler errors, prior to import. And ensure you have installed 2019 to a location without spaces. And again, compare the import process with a new/empty project.
     
  6. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    I did as you said, there were no errors and after successful import I was offered to make a backup. The error was saved in the log:
    Code (CSharp):
    1. 2019-05-28 20:58:08.071 5097-5150/? I/Unity: BuyProductID: FAIL. Exception during purchase. System.Exception: Error: called non-existent method System.Boolean UnityEngine.VR.VRSettings::get_enabled()
    2.       at UnityEngine.VR.VRSettings.get_enabled () [0x00000] in <filename unknown>:0
    3.       at UnityEngine.Purchasing.GooglePlayAndroidJavaStore.Purchase (System.String productJSON, System.String developerPayload) [0x00000] in <filename unknown>:0
    4.       at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <filename unknown>:0
    5.       at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <filename unknown>:0
    6.       at IAP.InAppManager.BuyProductID (System.String productId) [0x00000] in <filename unknown>:0
    7.       at BuyCoinsButt+<DoBuyCoins>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    Did you build to a new APK and install on your device? And this log is from that test?
     
  8. randjtw

    randjtw

    Joined:
    Dec 27, 2016
    Posts:
    3
    Unity Version: 2019.1.4f1
    IAP Version: 1.22.0
    IL2CPP build
    Android SDK build tools: 28.0.3
    Android SDK Platform: 28

    1. The same problem, even if I start from "empty project".
    2. I just following https://forum.unity.com/threads/exc...r-vrsettings-get_enabled.518868/#post-4401505
    , I proved it works.
    3. May be my attach file can help others user, unzip it and replace to "Assets\Plugins\UnityPurchasing\Bin". (file is removed, because https://forum.unity.com/threads/exc...ttings-get_enabled.518868/page-3#post-4590163)
    4. @JeffDUnity3D If my method is illegal, please tell me.

    ---------------------------
    [solved] by https://forum.unity.com/threads/exc...ttings-get_enabled.518868/page-2#post-4517053

    step 1. remove current editor.
    step 2. In Unity Hub, change editor install path to any folder name without space.
    step 3. create a empty project.
    step 4. Import IAP package, and I see the "API updater notice window", finally.

    @Unity company
    How could your RD team make this low level mistake?
     
    Last edited: May 29, 2019
    Chaz32621 likes this.
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    You would not want to copy and replace any files, and not clear on what you mean by illegal. In step 2, you say "I proved it works". Because in step 1, you say you have the same problem. So what did you prove that works in step 1? What is your Unity install path? To be clear, you need to install Unity to a path with no space. Delete IAP, make sure you have no compile issues, and reinstall Unity IAP and ensure you get the API update prompt. Build and deploy.
     
  10. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    Yes. Exactly.
    I use Unity 2018.3 and I can not upgrade higher.
     
  11. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
  12. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    I saw your message .. No, I have no spaces in the full path to the project.
     
  13. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    The fix has landed in our main dev repo and also in 19.2; today I get a notification that the portback to 19.1 has been approved so it should land in 19.1 soonish.

    Adriano
     
  14. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    Hi, not the project, the Unity install path. Are you on windows? If so, most likely you have (\program files\...). The behavior you described matches the bug I've fixed if Unity is installed to a path with spaces.

    Adriano
     
  15. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    My path to Unity doesn't have spaces.
     
  16. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    That is odd. Anyway, the behavior you described matches what I'd expect if AssemblyUpdater.exe does not run correctly (which would happen if you had spaces in the path).

    When you open your project do you see the dialog asking whether you want to update your scripts/assemblies ?

    Can you share your Editor.log and the following files ?
    • Assets/Plugins/UnityPurchasing/Bin/Stores.dll
    • Assets/Plugins/UnityPurchasing/Bin/Editor.dll

    Adriano
     
  17. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    No
    Yes:
    https://drive.google.com/open?id=12LDVXmx-Kz0fBm5ahbt06_VoE-mHfT-b
    https://drive.google.com/open?id=1HDlgvFuX-2i3yXXir83KQaCF_UWVs6jg
    https://drive.google.com/open?id=13KCAB2rEaZNnvjdnF-TcrzFcFkgo68N7
     
  18. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    I believe we may have found the issue. The IAP Installer appears to be failing about 1/2 way through for other reasons. It leaves 3 unitypackages behind in Plugins/UnityPurchasing - iap.unitypackage, channel.unitypackage, and udp.unitypackage. Double click on each in that order, and it should trigger the proper import. This process worked for me (after several hours trying to figure out what was going on!) with Unity 2019.1.4f1, not tested yet with other versions of Unity 2019. I now no longer receive the errors that others have reported here regarding the editor and store dll's, missing UnityChannel folder, etc. We are looking into this.
     
  19. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    Hello.
    Where do i need to click on them?

    Thank you.
     
  20. randjtw

    randjtw

    Joined:
    Dec 27, 2016
    Posts:
    3
  21. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
  22. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
  23. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
  24. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    I think it should be under Assets\Plugins\UnityPurchasing

    Adriano
     
    JeffDUnity3D likes this.
  25. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    I entered the folder through the editor and did not see such files.
     
  26. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    If you have replaced any files, etc, you likely will not see them. This was my result upon importing IAP on a brand new project, using 2019.1.4f1
     
  27. Wolfaks

    Wolfaks

    Joined:
    Feb 22, 2019
    Posts:
    12
    I reimport plugin again... These files appear, and after successful installation of the plugin they disappear .. But the error remains the same.
     
  28. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    Understood, you (unfortunately) might want to avoid Unity 2019 for now.
     
  29. smokinpuppy

    smokinpuppy

    Joined:
    Sep 1, 2018
    Posts:
    16
    I'm having the same issue, I've also tired it on 2019.1.5f1 and still the problem is there. What can I do? My game is practically ready to publish, this it the only thing left.
     
  30. icebear007

    icebear007

    Joined:
    Jun 8, 2016
    Posts:
    66
    I get the same UnityEngine.VR.VRSettings::get_enabled() error so I tried to move Unity to a folder without spaces in the path and then tried to reimport In-App Purchasing (following https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/). However, I can't import it anymore because it fails with this error now:
    Did someone else get this as well and fixed it?
     
  31. PayandaOnline

    PayandaOnline

    Joined:
    May 5, 2018
    Posts:
    11
    Last edited: Jun 9, 2019
  32. randjtw

    randjtw

    Joined:
    Dec 27, 2016
    Posts:
    3
    If your unity editor install path(primary or secondary) include any "space". I suggest you reinstall it. Please see my post. ( https://forum.unity.com/threads/exc...ttings-get_enabled.518868/page-3#post-4589986 )
     
    PayandaOnline likes this.
  33. PayandaOnline

    PayandaOnline

    Joined:
    May 5, 2018
    Posts:
    11
    Yes I saw. but it still didn't work for me. my installed path is : "C:\Program Files\Unity\Hub\Editor\2019.1.5f1" does not contains "space".
    the problem persisted again. Logcat Error Exception: System.Boolean UnityEngine.VR.VRSettings :: get_enabled ().
    I downgraded the iap version and it works now.
     
  34. AlexNagorny

    AlexNagorny

    Joined:
    Apr 22, 2015
    Posts:
    4
    Program Files contain space. Program (space) Files
     
  35. smokinpuppy

    smokinpuppy

    Joined:
    Sep 1, 2018
    Posts:
    16
    I'm on a mac, my install directory is "/Applications/Unity" no spaces, even my project directory is "/Users/roberthaddad/Desktop/Unity/GalaxyPatriot" (I changed "Galaxy Patriot" to "GalaxyPatriot" after reading your post" also no spaces. Still it isn't working. On another post from unity they said it was a bug in 2019.1, so I'm still waiting to see if there is a fix. Any assistance would be very much appreciated.
     
    PayandaOnline likes this.
  36. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    No updates yet at this time, there are unfortunately multiple issues with 2019. Please keep an eye on this thread, I will update it when more information is available https://forum.unity.com/threads/notice-iap-issues-with-unity-2019.689647/
     
  37. smokinpuppy

    smokinpuppy

    Joined:
    Sep 1, 2018
    Posts:
    16
  38. smokinpuppy

    smokinpuppy

    Joined:
    Sep 1, 2018
    Posts:
    16
    I tried what you just posted in the notice, and it seems to install 1.22 properly, but then I get this Visual C# compiler error: "error CS1704: An assembly with the same simple name 'Editor' has already been imported. Try removing one of the references (e.g. '/Users/roberthaddad/Desktop/Unity/Galaxy Patriot/Library/ScriptAssemblies/Editor.dll') or sign them to enable side-by-side."

    Do you know how I can fix that?

    Thanks,

    Robert
     
  39. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
  40. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    Sorry I do not. I tested on a new/empty project, please try the same.
     
  41. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    Can you share your Editor.log with me? I want to make sure sure the ApiUpdater bug is not the cause of your problems.

    Adriano
     
  42. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    228
    It has been fixed in 2019.3 and back ported to 2019.2b5 / 2019.1.6f1.

    Adriano
     
    Chaz32621 likes this.
  43. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
    Ah gotcha didnt know if 2019.3 was mainline or 2020.1 was hahaha
     
    PayandaOnline likes this.
  44. Kay-Mighty

    Kay-Mighty

    Joined:
    May 9, 2017
    Posts:
    5
    I followed your solution and it worked!
     
  45. Afro-Ninja

    Afro-Ninja

    Joined:
    Oct 1, 2012
    Posts:
    12
    Hi- I just encountered some pretty gnarly issues with Unity IAP and the Unity Package Manager in Unity 2018.4.3.f1 (LTS). This solution generally worked for me but I wanted to provide some context/insight:

    I started by trying to install Unity IAP through the services panel. After enabling IAP and clicking "import," the process seemed to fail at some point. The error was always "Reload Assembly called from managed code directly. This will cause a crash. You should never refresh assets in synchronous mode or enter playmode synchronously from script code."

    I finally realized that Unity was leaving behind those three package files, like you said. I double clicked to install them. For some reason my OS (windows 10) started asking me what program I wanted to open them in, even though they had the .unitypackage extension. When I selected "Unity" as the program to open them with it kept trying to start a new instance of the editor when double clicking on them. No idea if this was an unrelated problem or not.

    I was finally able to install the packages by manually selecting them through Assets > Import

    At several points during this installation Unity asked me if I wanted to run some kind of IAP upgrade/integration tool, which I said yes. It also kept asking me if I wanted to upgrade old/deprecated code, to which I said no. (I had not received this error in relation to anything else in my project before so I don't know what it wanted to upgrade) Also worth mentioning: when the old IAP import process broke, this same upgrade/integration tool kept trying to run at random times like when I entered play mode, or saved my project.

    Regardless, it seems like everything has been installed at this point. I just need to do actual testing now.

    A point of confusion, however: When inspecting the Unity package manager, it has its own section for installing the latest IAP package. Even though the services panel told me that IAP was up to date, the Package Manager window told me that a newer version was available (2.0.3 > 2.0.6)

    I'd also like to add that the Unity Package manager completely busted my automated build process pipeline that I ran through the terminal on osx. It would say that the manifest file was missing, try to create a new one, then say that it couldn't be re-initialized. I just had to manually copy my files and open them in the editor to get it to build.
     
    Last edited: Jul 11, 2019
  46. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    This is a new issue, please open a new thread. You need both the IAP Asset package and the Package Manager package also.
     
  47. Afro-Ninja

    Afro-Ninja

    Joined:
    Oct 1, 2012
    Posts:
    12
  48. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
  49. on15floor

    on15floor

    Joined:
    Mar 24, 2019
    Posts:
    1
    Thank you! After a week of my torment, it worked!)