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 MaverickPL
Mar 13 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)
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 bouemama
Mar 24 at 10:33 PM
This how I fix this error .... Double click on red alert will open "PurchasingCheck.cs" codes :
#error "Unity IAP plugin is installed, but Unity IAP is not enabled. Please enable Unity IAP in the Services window."
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
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
Answer by nicholasr
Mar 29 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.
Answer by milox88
6 days ago
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!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
145 People are following this question.
Services option cannot be pressed and cannot be on
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
Unity switches scenes when Ad is closed.
Help guys plz How to create room in uNet
Unity Ads not showing in editor (dummy ad placement is not showing too) as well as in the build.