Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Solved] Unity IAP services not found - Must turn off / on to fix

Discussion in 'Unity IAP' started by TitanUnity, Mar 9, 2017.

Thread Status:
Not open for further replies.
  1. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    Our team has migrated to Unity 5.5.2f1. Some of our developers are noticing that the Unity Editor will start throwing the following error related to IAP:

    #error: '"Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window."'

    To fix this issue the solution seems to be to switch IAP off and then back on again. When we check version control to see what performing this action does, all we see is a UnityConnectSettings.asset file but there are no changes to the file in SourceTree, we can even discard this file and the editor continues to work properly.

    Not a major problem but it's getting annoying as this happens multiple times a day during the course of development. Any ideas what might be happening here?
     
  2. ap-unity

    ap-unity

    Unity Technologies

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

    We've had users report this issue when one of their team members does not have IAP / Analytics enabled. If they don't have it enabled, they might be updating the ProjectSettings or UnityConnectSettings, which would then be saved in your version control.

    If you could, please confirm that everyone on the team has Analytics and IAP enabled. You should also confirm that every team member is added to your Organization and Project in the developer dashboard:
    http://developer.cloud.unity3d.com/

    If that doesn't resolve the issue, let me know and I'll talk to the team that manages the Services window and see what the issue might be.
     
  3. TitanUnity

    TitanUnity

    Joined:
    May 15, 2014
    Posts:
    180
    As I mentioned above, every time this occurs, the user that experiences the problem must switch the IAP toggle off / then back on. This causes a UnityConnectSettings.asset file appear in the user's uncommitted changes in SourceTree, but when we inspect that file for differences there are no changes, yet it fixes the issue? Super weird. I just want to be clear that there is never a case where one of our users has IAP turned off. It seems that something else is going on here.
     
  4. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    452
    I've been experiencing this as well. Extremely annoying. Pulled IAP from the project in the hopes that it will be fixed soon.
     
  5. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @TitanUnity, @gregorypierce, @gegagome

    I just spoke with our engineering team. They are aware of this bug and actively working to get it fixed. I understand it is frustrating to have to have these errors hinder your development process. (We are also going to make those messages Warnings instead of Errors, which should make them a bit less annoying in the future.)

    Thank you for your patience while we resolve this issue.
     
  7. Jonathan-FourFats

    Jonathan-FourFats

    Joined:
    Apr 21, 2016
    Posts:
    22
    we am having this issue as well, and unity services tab is missing, its not in the menu bar as well. I have no way to toggle it. Collab is showing a blank window, i have a full day of bug fix in it....
     
  8. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @UDN_f2797471-3ee5-4459-87fe-e6f33e1d8670

    Which version of Unity are you using? The Services window was added in 5.2, so it should be visible in the Window menu.

    Typically, if you are not able to see any content in the Services window, it is usually an internet connectivity problem.
     
  9. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    I am using 5.6.1f1 and even though I get the message I still get a bunch of errors after unchecking IAP from my projects.
    Assets/Plugins/UnityPurchasing/script/IAPDemo.cs(26,39): error CS0246: The type or namespace name `IStoreListener' could not be found. Are you missing an assembly reference?
    and 10 more like this.

    So I went ahead and removed IAPDemo.cs and I am still getting errors:
    FileNotFoundException: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:59)
    System.Reflection.MonoMethod.GetPseudoCustomAttributes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:293)
    System.MonoCustomAttrs.GetPseudoCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:78)
    System.MonoCustomAttrs.IsDefined (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MonoCustomAttrs.cs:301)
    System.Reflection.MonoMethod.IsDefined (System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:274)
    System.Attribute.IsDefined (System.Reflection.MemberInfo element, System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Attribute.cs:326)
    System.Attribute.IsDefined (System.Reflection.MemberInfo element, System.Type attributeType) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Attribute.cs:299)
    UnityEditor.EditorAssemblies.ProcessStaticMethodAttributes (System.Type type) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:101)
    UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:164)
    UnityEditor.EditorAssemblies:processInitializeOnLoadAttributes()


    Unloading broken assembly Assets/Plugins/UnityPurchasing/Bin/Editor.dll, this assembly can cause crashes in the runtime

    FileNotFoundException: Could not load file or assembly 'UnityEngine.Purchasing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:59)
    System.Reflection.MonoMethodInfo.GetAttributes (IntPtr handle) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:75)
    System.Reflection.MonoMethod.get_Attributes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:245)
    System.Reflection.MethodBase.get_IsSpecialName () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:184)
    UnityEditor.Build.BuildPipelineInterfaces.InitializeBuildCallbacks (Boolean findBuildProcessors, Boolean findSceneProcessors) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:149)

    The Unity IAP plugin is installed, but Unity IAP is disabled. Please enable Unity IAP in the Services window.
    UnityEditor.EditorApplication:Internal_PlaymodeStateChanged()

    The Unity IAP plugin is installed, but Unity IAP is disabled. Please enable Unity IAP in the Services window.
    UnityEditor.EditorApplication:Internal_CallDelayFunctions()

    The Unity IAP plugin is installed, but Unity IAP is disabled. Please enable Unity IAP in the Services window.
    UnityEditor.Toolbar:OnGUI()

    The Unity IAP plugin is installed, but Unity IAP is disabled. Please enable Unity IAP in the Services window.
    UnityEditor.EditorApplication:Internal_PlaymodeStateChanged()

    Any ideas?
     
    Last edited: May 30, 2017
  10. Woj_Gabel_FertileSky

    Woj_Gabel_FertileSky

    Joined:
    Jun 18, 2012
    Posts:
    61
    What patience?!?! I am frustrated as hell. And I need to work with this. I have no choice. I am forced.
    It is a nightmare. No only this but the whole UWP platform.
     
  11. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    The worst is that this problem wasn't happening before March. Yet over two months have come and this issue still is causing trouble.

    Some people have freemium and paid versions of apps guys.
     
  12. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @TitanUnity, @gregorypierce, @gegagome, @Sedesikus

    I want to give a bit of context for why this is happening and what we are working to fix. Here's how things should work:

    1. You have a project with no services enabled yet. The service-specific extension in the engine is not loaded. (i.e. you can't use UnityEngine.Purchasing if IAP is not enabled.)
    2. You enable a service (like Unity IAP) and that extension is loaded in the engine.
    3. Now you can use any methods, interfaces, etc. in that extension.
    4. If you disable Unity IAP, then those methods are no longer defined, since that extension isn't loaded. So you get errors such as "The type or namespace name `IStoreListener' could not be found."

    That is the expected workflow and it would be fine. However, there seems to be cases where services are disabled when they shouldn't be. That is the underlying issue that we are working to fix. There is a fix in QA right now that we hope to resolve part of the problem. (We have found that timeouts are one case where services are getting disabled.)

    We made a change to the Services window in early March that resolved the problem of users overwriting other's settings. Currently, the Service window will respect the local settings over the settings in the server.

    To help troubleshoot any remaining issues, I would suggest a couple of things:
    • In Editor Settings (Edit -> Project Settings -> Editor) change Asset Serialization mode to "Force Text" (This will allow you to view the contents of the UnityConnectSettings.asset)
    • Make sure to save your project whenever you make a change to the Services window. (Changes are also saved when you close Unity normally.)
    If anyone else has this issue (the IAP extension getting disabled even when the Service is enabled), please send a support ticket with the following information:
    • Project ID
    • UnityConnectSettings.asset (in Text Mode)
    • The context of the error (did it happen when you started Unity, when you left it open for hours, while you were actively using the Editor, etc.)
    https://analytics.cloud.unity3d.com/support/
     
    Last edited: May 31, 2017
    GarthSmith likes this.
  13. ap-unity

    ap-unity

    Unity Technologies

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

    I apologize for not understanding your specific use case earlier. If you want to have a project that will have some builds with Purchasing enabled and some builds without Purchasing enabled, then you will need to do a couple of things:
    • Remove IAPDemo.cs
    • Remove Demo/DemoInventory.cs
    • Use preprocessor directives to basically hide all the purchasing code from the builds with Purchasing disabled.
    Code (CSharp):
    1. #if UNITY_PURCHASING
    2. using UnityEngine.Purchasing;
    3.  
    4. // All IAP code can go here
    5. // If IAP is enabled, it will work
    6. // If IAP is disabled, none of this code will run
    7. #endif
     
  14. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Thank you @ap-unity
     
    ap-unity likes this.
Thread Status:
Not open for further replies.