Search Unity

IAP Import Issues with Android Only (Unity 5.3.4)

Discussion in 'Unity IAP' started by TheDreamEXE, Sep 16, 2018.

  1. TheDreamEXE

    TheDreamEXE

    Joined:
    May 14, 2015
    Posts:
    60
    Hello all, I need help. I've been struggling with this for the last three days and I have no idea what the cause is. So I'm making a project on Unity 5.3.4f1 and I'm trying to integrate IAP, but when I import the package I get this error when I switch to Android platforms:


    Code (CSharp):
    1. ReflectionTypeLoadException: The classes in the module cannot be loaded.
    2. System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
    3. UnityEditor.Purchasing.UnityIAPInstaller.<GetPurchasing>m__1 (System.Reflection.Assembly assembly) (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:102)
    4. System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator14`3[System.Reflection.Assembly,System.Type,<>__AnonType0`2[System.Reflection.Assembly,System.Type]].MoveNext ()
    5. System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[<>__AnonType0`2[System.Reflection.Assembly,System.Type]].MoveNext ()
    6. System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[<>__AnonType0`2[System.Reflection.Assembly,System.Type],System.Type].MoveNext ()
    7. System.Linq.Enumerable.First[Type] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
    8. System.Linq.Enumerable.FirstOrDefault[Type] (IEnumerable`1 source)
    9. UnityEditor.Purchasing.UnityIAPInstaller.GetPurchasing () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:100)
    10. UnityEditor.Purchasing.UnityIAPInstaller.EnablePurchasingService () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:481)
    11. UnityEditor.Purchasing.UnityIAPInstaller.Install () (at Assets/Plugins/UnityPurchasing/Editor/UnityIAPInstaller.cs:329)
    Now, I've tried everything I could imagine after searching the forums for hours. Things I have tried include:
    • Importing/reimporting both with and without logging off and back on, closing and restarting Unity, etc
    • Uninstalling and reinstalling Unity. Deleting all cache data, roaming files and folders
    • Deleting the Unity.package.dll or whatever the name was inside of my project assets folder
    • changing .dll import settings
    • Creating a new project and importing IAPs, giving me the same error.
    • Tried using IAP auto installer, and manually imported IAP versions 1.16, 1.17, 1.20, and 1.21
    • Manually commented out the lines at UnityIAPInstaller.cs:102 to see if it helped, and it didn't as it was an integral part of the installer's code
    • Deleting the IAPInstaller.cs file
    I'm stuck. I have no idea why this is doing this.If anyone has any ideas or suggestions, please let me know. It's driving me nuts
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi @TheDreamEXE ,
    Please note that Unity IAP 1.20.0 and 1.21.0 don't support Unity 5.3.x. So please use a previous version.
    I imported a Unity IAP package in Unity 5.3.4 and didn't get any error.
    Could you please try it out in a new project?
    Could you please send me a project which could reproduce this issue?

    Once you import Unity IAP successfully, you shouldn't have 'UnityIAPInstaller.cs' file any more.
    And please confirm that you don't have any compile error when importing Unity IAP. Otherwise, the installation process will be interrupted.
     
  3. TheDreamEXE

    TheDreamEXE

    Joined:
    May 14, 2015
    Posts:
    60
    I've tried it once before with 1.16 and 1.17 as mentioned above, but I don't think I've tried those two with a new project. I'll try again shortly once I'm home and if it doesn't work out, I'll send out a project file within 24 hours. Thanks for the feedback!
     
  4. TheDreamEXE

    TheDreamEXE

    Joined:
    May 14, 2015
    Posts:
    60
    Sigh...this is embarrassing. I had a duplicate Plugins folder hidden inside of one of my other folders. Everything is working fine!
     
  5. TheDreamEXE

    TheDreamEXE

    Joined:
    May 14, 2015
    Posts:
    60
    Oh, JK now the apk just gives me a black screen after building. Tested on two devices and tried with the demo IAP project as well with the same issue.
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220