Unity IAP plugin is installed, but Unity IAP is disabled - error
hi,
I'm constantly getting errors with Unity IAP when I'm working offline. It's slightly random, but definitely very frequent.
The gist is while I'm online and I can see the services on the Services tab then everything is fine. If I go offline though,a few minutes later, Visual Studio asks to Reload the project as there has been modifications. Browsing back to Unity I see loads of errors on the console relating to Unity IAP. Besides the one on the title, it also says "Could not load file or assembly UnityEngine.Purchasing, Version=0.0.0.0."
I can "fix" the problem by going online again, waiting for the services to refresh then go back to visual studio and reload the solution again, but this is happening way too often now to the point that it's slowing down my development.
I'm on version 5.5.0f3 using Visual Studio 2015 Enterprise Edition Update 2.
Any ideas would be very much appreciated.
thanks a bunch!
Answer by bouemama · Mar 24, 2017 at 10:33 PM
This how I fix this error .... Double click on red alert will open "PurchasingCheck.cs" codes :
#if !UNITY_PURCHASING
#error "Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window."
#endif
cut this code + save => unity services tab will reload and work
past the code again + save .
i think this is another bug still exist on last version 5.5.2f1
EDIT 2
since this is a known bug i just trying to set how i skip it
cut this code + save => unity
Assets reimport All
click services icone
past the code again + save .
Answer by MaxBackcountry · May 22, 2017 at 01:32 PM
Hi Nicholas,
I experienced the same problem (working with version 5.5.2 f1). But bouemama's workaround did not work for me. I had to remove the whole folder UnityPurchasing from the Assets/Plugins folder. After having done that services window in the editor loaded again (which was very important as we use Colleborate). After loading IAP service was toggled off.
I refrain from integrating the IAP plugin again. The problem occurred totally out of the blue. We had integrated the IAP plugin about two weeks ago and until today there were no problems.
What do you recommend? Update to 5.6? Thanks
Answer by MaverickPL · Mar 13, 2017 at 06:55 AM
I have the same problem ... Someone can fix that ? Im trying to relog, exit Unity, relog again and IAP not start.
TypeLoadException: Could not load type 'LODLightmapScale' from assembly 'UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
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 C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:95)
UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes () (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:158)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
Assets/Plugins/UnityPurchasing/script/PurchasingCheck.cs(3,0): error CS1029: #error: '"Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window."'
The Unity IAP plugin is installed, but Unity IAP is disabled. Please enable Unity IAP in the Services window.
Answer by nicholasr · Mar 29, 2017 at 05:37 PM
@bouemama @guimak @MaverickPL I apologize for the frustration. Thank you for sharing the issues and the workaround.
We're planning on addressing the online/offline "sensitivity" generally, for all Unity Services in an upcoming Unity version. We recognize its faults. The work is ongoing so no release date is available yet. A workaround that may also work is to manually copy the UnityEngine.Purchasing.dll into your project (from /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityPurchasing/ folder), bypassing the automatic copying currently performed by the Services window.
Also we're hopefully helping prevent perma-broken projects by changing the PurchasingCheck code to be a 'warning' in Unity IAP 1.10.1, shipping hopefully this week.
Please also mention where you're supposed to paste the dll file into in the project directory
Answer by milox777 · Apr 20, 2017 at 07:58 PM
God I hate Unity, I have the same problem, services just crap out for no reason, now I cannot compile, cannot open Services window, NOTHING!