Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors with Cesium for Unity package (created through developer guide) #433

Open
j9liu opened this issue Mar 14, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@j9liu
Copy link
Contributor

j9liu commented Mar 14, 2024

From this forum post.

Following the developer guide, the user successfully produced a .tgz file, but ran into errors while importing in Package Manager:

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(5,20): error CS0101: The namespace ‘’ already contains a definition for ‘UnitySourceGeneratedAssemblyMonoScriptTypes_v1’

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(2,6): error CS0579: Duplicate ‘System.Runtime.CompilerServices.CompilerGenerated’ attribute

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(3,6): error CS0579: Duplicate ‘System.ComponentModel.EditorBrowsableAttribute’ attribute

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(4,6): error CS0579: Duplicate ‘System.CodeDom.Compiler.GeneratedCodeAttribute’ attribute

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(301,40): error CS0111: Type ‘UnitySourceGeneratedAssemblyMonoScriptTypes_v1’ already defines a member called ‘Get’ with the same parameter types

Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs(276,10): error CS0579: Duplicate ‘System.Runtime.InteropServices.StructLayout’ attribute

Another forum user responded with the following fix:

Fixed it by opening the tar.gz and the tar inside it and doing the following modifications:

com.cesium.unity-1.8.0\package\Editor\generated\Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs:

class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 → UnitySourceGeneratedAssemblyMonoScriptTypes_v2
com.cesium.unity-1.8.0\package\Runtime\generated\Unity.SourceGenerators\Unity.MonoScriptGenerator.MonoScriptInfoGenerator\AssemblyMonoScriptTypes.gen.cs (there are 2 classes named UnitySourceGeneratedAssemblyMonoScriptTypes_v1):

class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 → UnitySourceGeneratedAssemblyMonoScriptTypes_v3
class UnitySourceGeneratedAssemblyMonoScriptTypes_v1 → UnitySourceGeneratedAssemblyMonoScriptTypes_v4
After that do “Add package from disk…” in the Package Manager

@j9liu j9liu added the bug Something isn't working label Mar 14, 2024
@j9liu j9liu changed the title Packaging Errors Errors with Cesium for Unity package (created through developer guide) Mar 14, 2024
@kring
Copy link
Member

kring commented Mar 14, 2024

I think this is related to #156. If so, another workaround is to use Unity 2021.3 to package the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants