Search Unity

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

Discussion in 'Unity IAP' started by ErinLKramer, Jul 10, 2018.

  1. ErinLKramer

    ErinLKramer

    Joined:
    Jun 20, 2015
    Posts:
    3
    I'm trying to implement an In-App Purchase in my game using the EasyMobile plugin (or Unity's Codeless IAP, I've tried both), and recently I've been getting this problem. I don't think it has anything to do with the plugin, but I thought I should mention it.

    My purchase button, when used from a device that installed the game from the Play Store as an Internal Tester, seems to attempt the purchase (the EasyMobile code does some checking and calls InitiatePurchase) and then just gives me this error and does nothing else:

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

    To a player, it just looks like the button is pressed and nothing happens, and nothing does happen (does not call purchase failure or success code). This exact same error pops up when I use Unity IAP's built-in Codeless IAP Button.

    It is probably worth noting - I've been to the following thread: https://forum.unity.com/threads/sol...ne-vr-vrsettings-from-assembly-stores.502732/
    The solution from this thread is to just reinstall Unity IAP and make sure I have the latest version. However, I just did that and also reinstalled EasyMobile to make sure I had the latest version on both, but the button still doesn't work.

    My game does not have any VR or AR support enabled (at least from what I can tell from Player Settings).

    I'm using Unity 2018.1.1f1 Personal, Unity IAP version 1.20.0, EasyMobile Pro 1.3.0, and if it matters, Android Studio 3.1.2 (not using it for development)

    EDIT: Also worth noting this happens on other devices that are completely unrelated to the developer account, also Internal Testers.
     
    Last edited: Jul 10, 2018
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @ErinLKramer During IAP import, did you receive the dialog popup asking to update the API, and asking if you've made a backup? You must select Yes to this prompt. Also, there can be no compiler errors during the import/upgrade process.
     
  3. ErinLKramer

    ErinLKramer

    Joined:
    Jun 20, 2015
    Posts:
    3
    I did select yes to that dialog popup.
    Come to think of it there may have been compiler errors up when I was importing it, but that's only because of the code that required Unity IAP to function.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you'll need to remove any code that references IAP during the IAP import process. We are working to improve this behavior.
     
  5. ErinLKramer

    ErinLKramer

    Joined:
    Jun 20, 2015
    Posts:
    3
    Okay, after commenting out all the lines of my code that used EasyMobile or Unity IAP, getting rid of both, importing Unity IAP and THEN EasyMobile, then uncommenting all my code and setting up both again, it looks like I've finally got it working.

    Thank you for the help, I didn't know I had to do that in a specific order.