System.MethodAccessException: Method `UnityEditor.Build.BuildDefines.add_getScriptCompilationD
C:/Users/chris/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.collab-proxy@1.2.15/Editor/Collab/CollabHistoryWindow.cs(20,56): error CS0122: `UnityEditor.Collaboration.ICollabHistoryWindow' is inaccessible due to its protection level
C:/Users/chris/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.collab-proxy@1.2.15/Editor/Collab/CollabToolbarButton.cs(11,42): error CS0246: The type or namespace name `SubToolbar' could not be found. Are you missing an assembly reference?
C:/Users/chris/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.collab-proxy@1.2.15/Editor/Collab/CollabToolbarWindow.cs(26,42): error CS0122: `UnityEditor.Web.WebViewEditorStaticWindow' is inaccessible due to its protection level
C:/Users/chris/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.package-manager-ui@2.0.3/Editor/Sources/Services/Upm/UpmBaseOperation.cs(33,34): error CS1061: Type `UnityEditor.PackageManager.PackageInfo' does not contain a definition for `author' and no extension method `author' of type `UnityEditor.PackageManager.PackageInfo' could be found. Are you missing an assembly reference?
C:/Users/chris/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.package-manager-ui@2.0.3/Editor/Sources/Services/Upm/UpmBaseOperation.cs(34,43): error CS1061: Type `UnityEditor.PackageManager.PackageInfo' does not contain a definition for `author' and no extension method `author' of type `UnityEditor.PackageManager.PackageInfo' could be found. Are you missing an assembly reference?
MethodAccessException: Method `UnityEditor.Analytics.AnalyticsSettings:get_enabledForPlatform ()' is inaccessible from method `UnityEditor.Analytics.AnalyticsImporter:<AnalyticsImporter>m__6 (UnityEditor.BuildTarget,System.Collections.Generic.HashSet`1<string>)'
UnityEditor.Build.BuildDefines.GetScriptCompilationDefines (BuildTarget target, System.String[] defines) (at C:/buildslave/unity/build/Modules/BuildPipeline/Editor/Managed/BuildDefines.cs:20)
UnityEditorInternal.InternalEditorUtility:GetCompilationDefines(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget, ApiCompatibilityLevel)
UnityEditorInternal.InternalEditorUtility:GetCompilationDefines(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget) (at C:/buildslave/unity/build/Editor/Mono/InternalEditorUtility.cs:424)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
发生场景:打开别人的工程,一下100多个错。
解决办法:
大概意思就是让你新建个unity项目,然后把Packages
里面的manifest.json
拷贝出来,替换原来项目里面的manifest.json
。