Search Unity

Could not load type 'UnityEngine.VR.VRSettings' from assembly 'Stores'.

Discussion in 'Unity IAP' started by Barquest, Mar 12, 2018.

  1. Barquest

    Barquest

    Joined:
    Jun 5, 2017
    Posts:
    2
    i know this thread is closed before... but i have the same problem and that is not fixed when i update it, when i re import, i already try to make a new project and move the script over there and i try it but it didnt work, my unity version is 2017.3.1f1 and iap version is 1.17.0.

    any help? my life is depend on this
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Barquest,

    This is due to a change in the VR API in 2017.x (It was changed to the XR). The only thing you need to do is run the API Updater in the Editor. This should pop up when you install Unity IAP. However, if you do not, you can always run it from the Assets menu:
    api-updater.png
     
  3. Barquest

    Barquest

    Joined:
    Jun 5, 2017
    Posts:
    2
    my "Run API Updater..." Marked As Grey i cant Click it...
    i try to force it but it no works, the popup window when there is an option "yes i create Backup" not opening...
     

    Attached Files:

  4. Benvictus

    Benvictus

    Joined:
    Sep 12, 2013
    Posts:
    87
    I would suggest removing your purchasing script from your assets folder as you re-import the IAP plugin. Once the IAP plug-in has re-imported, place the purchasing script back into the asset folder. This worked for me.

    Note: Make sure to re-assign any references in the inspector.
     
  5. canvassoft

    canvassoft

    Joined:
    May 17, 2015
    Posts:
    2
    I am in the same situation.

    "Could not load type 'UnityEngine.VR.VRSettings' from assembly 'Stores'."
    and error message appears and Android purchase processing fails. (iOS was successful)

    - I made a simple test project below and tried it, but I could not purchase a similar error code.
    https://canvas_soft@bitbucket.org/canvas_soft/testproject.git

    - Reinstalling the IAP according to the procedure below also failed.
    (A new UnityPurchasing / UnityChannel will be added when I press the [In-App Purchasing] import but I was not asked if I created a backup.)
    https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/

    - "Run API Updater..." written in this post was too gray and could not be clicked.
    https://forum.unity.com/threads/cou...ne-vr-vrsettings-from-assembly-stores.521484/

    - The environment is as follows.
    Mac High Sierra 10.13.4
    AndroidStudio 3.1
    Unity2017.3.1f1

    Did I missed anything? Thanks.
     
    Last edited: Apr 21, 2018
  6. canvassoft

    canvassoft

    Joined:
    May 17, 2015
    Posts:
    2
    Additional notes:
    Changing "Scripting Backend" of the above project from "Mono" to "IL2CPP" caused no error and the purchase was successfully completed.
    But, since it takes time to build, please tell me how to work with Mono.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you were not prompted for a backup, then you likely have a compiler error which is preventing the updater from working correctly. Please confirm with an empty/new Unity project and import IAP only.
     
  8. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    +1 I got the same issue here. I tried everything I read in other post and I cant make it to work. It work Fine on Editor, Not on Android devices. I get the error TYPELOADEXECPTION: Couldnt not load UNITYENGINE.VR.VRSettings. I deleted the 2 Plugins folder and Imported again unity iaps, the double clicked on the UNITYIAP to import all. AGAIN WORKS on Editor not on Android . I dont see any errors in the UNITY console. I only see error with Android DEBUG when its not working and still looking forVR.VRSettings which according to other post SHOULD not anymore. I am using latest UNITY .4 and the problem is still there. I dont know what elso to do. I CANT GET IT TO UPDATE

    UnityIAP Version 1.18.0 seeing on Debug Console when running my app from editor and finishes with OnInitialized :pASS and UNITYIPA: PROMO is Ready.

    Purchase stuff works on Editor,

    On Android NOTHING HAPPENS. LOGS FROM Device AGAIN its looking for VR.VRSETTINGS and not the new one you guys are talking about.

    Sorry for Bad English, did my best :)
     
    Last edited: Apr 24, 2018
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Once again, if you are not prompted to update your API during the IAP import, you can stop there as something is not right. Please confirm on a new/empty project. This step is important.
     
  10. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    I just tried in a new project and I didnt get any prompt to update API
     
  11. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    The class UnityEngine.VR.VRSettings could not be loaded, used in Stores.dll
     
  12. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    This is the Logs I get when I am running in editor. nothing seems wierd expet the Failed to fetch but I am reading in another forum post about that according to one Dev this should not be the cause of malfunctioning of the purchase. On EDITOR I dont see any crash!.



    Link to image: https://www.dropbox.com/s/vm5fbziurd01zgb/Console.jpg?dl=0


    However when I try on a Android DEVICE here are the device logs where is seems to crash (as other function are not called after that)

    04-24 11:26:18.373: I/Unity(26137): Purchasing product asychronously: 'hint1'
    04-24 11:26:18.373: I/Unity(26137):
    04-24 11:26:18.373: I/Unity(26137): (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    04-24 11:26:18.374: W/mono(26137): Missing method get_enabled in assembly /data/app/com.CENSUREDCOMPAGNIE.CENSUREDGAMENAME-1/base.apk/assets/bin/Data/Managed/Stores.dll, type UnityEngine.VR.VRSettings
    04-24 11:26:18.374: W/mono(26137): The class UnityEngine.VR.VRSettings could not be loaded, used in Stores
    04-24 11:26:18.381: E/Unity(26137): TypeLoadException: Could not load type 'UnityEngine.VR.VRSettings' from assembly 'Stores'.
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product) [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at PurchaseManager.BuyProductID (System.String productId) [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at PurchaseManager.BuyConsumable () [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at Purchases.Button1Hint () [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.Events.InvokableCall.Invoke () [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <filename unknown>:0
    04-24 11:26:18.381: E/Unity(26137): at UnityEngine.UI.Button.Press () [0x00000] in <filename un
     
    Last edited: Apr 24, 2018
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is what we need to troubleshoot then as a first step. What version of Unity are you on?
     
  14. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    Unity 2017.4.1f1

    But my initial project was started with Unity v 2016
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Good to know, I haven't tested yet with 2017.4.1. I will do that now and will provide my results in a few minutes.
     
    Last edited: Apr 24, 2018
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Whyper I tested on 2017.4.1 without issue and properly received the API upgrade prompt. There is a one minute video here of my steps https://www.screencast.com/t/DobrExxRr Can you confirm that you are following the same steps?
     
  17. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    Yes I do the exact same steps, exepct I dont get the Update prompt anymore (I got it once the first time I did it) but when I delete Ipads folder and repeat the steps. I get all that expect the Upgrade Steps (which as to make backup to be safe)
     
  18. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Whyper Thanks for the video. So you're saying that the Upgrade API prompt only happened on the very first project that you imported IAP, and on subsequent NEW projects, you are no longer receiving the pop up? That is not my experience, I can repeatedly create new projects and always get the Upgrade API prompt. Or, are you deleting already-imported folders on an existing project, then re-importing? Please provide specific steps to reproduce. Also, please review this forum post regarding deleting the folders and reimporting https://forum.unity.com/threads/iap-troubleshooting-remove-and-reinstall-unity-iap.511747/
     
  20. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    Yes , with FULLY NEW PROJECT it does not show update pop up. For my project where Iaps are all broken on Android devices and Looks for VR.VR. yes I followed this exact Forums post and checked the previously post you closed as Fixed wheere you linked the same post steps. Ill do a video where I create new project....
     
  21. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Whyper Understood. But you did mention you got the popup one time? Did anything change in your environment since then? I will check with the IAP team and get their feedback also.
     
  23. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    nothing changed. Just Iaps crash on Android devices
     
  24. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, the Android crash would be expected if you don't get the API Update prompt in the Editor. One thing to test per the IAP team. It might be a permissions issue and Unity is not able to write to the file system properly. Can you try running Unity as an Administrator, and/or create the project in a known writable location, like under C:\Users\[username]\Documents ?
     
  25. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    Ok I Ran as administator and created new project in default path (Users\Username\Documents) and I did get the Update prompt this time. Does this mean that the iap is upgraded for my Game project as well and rebuilding an .APK should work now?
     
  26. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    No it didnt work like that. However, I transfered all my game project folder into the default path (User\Username\Document) and doing the step of deleting iAPS folder and reimporting when in this location worked.
    Now my purchase are working on Android. I dont say that the issue is fixed for future ppl that still get it but placing the project folder into the default location could fix issue for a couple of ppl until you guy fix this..Anyhow Thanks I can now sleep lol
     
  27. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you would need to reimport or create a new project in the writable location, not just move the project. It's not the default location that is important, you need a location that the user running Unity can read and write to and would likely affect not just IAP. Can you share the permissions that the previous location has for the user that you typically use, compared to the new location? We could provide a popup warning if we detect that we can't write properly to the selected location.
     
  28. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    My unity project was on a second HardDrive. Just to say that even if I ran Unity as Administartor when the project was still on second HD(D:) I did not get the Update pop up for iaps.ONLY After moving the project folder to C:\User\USERNAME\Document , it worked
     
  29. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Whyper As it is a permissions issue, please share the specific file/folder permissions for the previous and new locations. Since I don't have your hard drive here, it is not possible for me to test directly.
     
  30. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    The difference between D folder and MyDocument folder is FULL CONTROL , on my document it has it enable, on D Full control is not checked

    All other permissions have the same checked
     
  31. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is your logged in user an Administrator on this system? I created a folder and removed Full Control and had no issue, but my local user is also an administrator. It could be that since I created it, I am also the owner so Full Control is implied. Can you confirm that the hard drive and/or folder is not set as Read Only? Was it originally created by another user?
     
    Last edited: Apr 25, 2018
  32. Whyper

    Whyper

    Joined:
    Jul 30, 2013
    Posts:
    16
    The folder was indeed Read-Only in the D drive And yes my user is Administrator
     
  33. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sounds like the issue is resolved for you. A read-only location would not be expected to work properly.
     
  34. Yiming075

    Yiming075

    Joined:
    Mar 24, 2017
    Posts:
    33
    I have this problem too, any better solution?
     
  35. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Yiming075 Please provide steps to reproduce in your situation and the versions. Did you get the API Updater prompt?
     
  36. Bess2k2

    Bess2k2

    Joined:
    May 7, 2017
    Posts:
    11
    Hi Jeff I'm having the same issue but I'm on a Mac, Using Unity 2017.4.18. IAP work fine on iOS but not on android. Im getting E/Unity(21254): TypeLoadException: Could not load type 'UnityEngine.VR.VRSettings' from assembly 'Stores'. I have tried deleting and reinstalling but no luck. I cant get the API to update either, its grayed out even on a new project. Importing other assets/scripts does prompt the api updater though. Using Unity IAP 1.20 btw. Any ideas on what to do next?
     
    Last edited: Mar 11, 2019
  37. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @Bess2k2 So importing IAP on a brand new project does not trigger the Update API dialog? Are you able to upgrade to a more recent version of Unity, as a test?
     
  38. Bess2k2

    Bess2k2

    Joined:
    May 7, 2017
    Posts:
    11
    IAP doesn’t trigger an API update. I can import another old script and it will update though. I haven’t tried 2018 yet. I can give it a shot. I will keep you posted. Thanks!
     
  39. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  40. Bess2k2

    Bess2k2

    Joined:
    May 7, 2017
    Posts:
    11
    Heres a quick update. Upgraded to 2017.4.23 and still couldn't trigger the API update even on a new project. Downloaded 2018.3.8 and the API update worked, unfortunately converting my already released project from 2017 to 2018 opened up a couple of new problems I dont wish to deal with right now. I will stick with 2017 and wait/hope for an update.