c# - 统一应用购买错误
问题描述
我可以统一玩我的游戏,但是如果我尝试将游戏构建到 android,它就不起作用并且会弹出错误消息。
错误信息 1:ArgumentException: The Assembly UnityEditor is referenced by Editor ('Assets/Plugins/UnityPurchasing/Bin/Editor.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List 1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary 2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:154)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:194)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
错误信息 2:Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
错误信息 3:UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
错误消息 4:Assets/Plugins/UnityPurchasing/Editor/IAPButtonEditor.cs(109,6): error CS0103: The name "ProductCatalogEditor" does not exist in the current context
解决方案
确保您没有从 Unity/projectname/Assets/Plugins/UnityPurchasing/Bin 文件夹中删除 Editor.dll。祝你好运!