Remove Unity related symbols from Nuget projects by pCYSl5EDgo · Pull Request #1888 · MessagePack-CSharp/MessagePack-CSharp · GitHub
Skip to content

Remove Unity related symbols from Nuget projects#1888

Merged
AArnott merged 10 commits into
MessagePack-CSharp:developfrom
pCYSl5EDgo:AvoidDynamic
Jul 19, 2024
Merged

Remove Unity related symbols from Nuget projects#1888
AArnott merged 10 commits into
MessagePack-CSharp:developfrom
pCYSl5EDgo:AvoidDynamic

Conversation

@pCYSl5EDgo

Copy link
Copy Markdown
Contributor

Closes #1886

@pCYSl5EDgo pCYSl5EDgo closed this Jul 18, 2024
@pCYSl5EDgo pCYSl5EDgo reopened this Jul 18, 2024

@AArnott AArnott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Thanks. Just one cleanup opportunity please.

Comment thread src/MessagePack/Resolvers/DynamicObjectResolver.cs Outdated
@pCYSl5EDgo

pCYSl5EDgo commented Jul 18, 2024

Copy link
Copy Markdown
Contributor Author

Comment thread src/MessagePack/Resolvers/DynamicObjectResolver.cs Outdated
@AArnott AArnott merged commit 5793c81 into MessagePack-CSharp:develop Jul 19, 2024
@AArnott AArnott added this to the v3.0 milestone Jul 19, 2024
@pCYSl5EDgo pCYSl5EDgo deleted the AvoidDynamic branch July 19, 2024 05:21
@evorowy-jk

evorowy-jk commented Jul 28, 2024

Copy link
Copy Markdown

Will you guys be able to push this fix onto nuget? There is a serious problem with AOT support right now as nuget packages don't obey MESSAGEPACK_FORCE_AOT or ENABLE_IL2CPP. Resulting in NOT_SUPPORTED exception on Android IL2CPP.

@AArnott

AArnott commented Jul 29, 2024

Copy link
Copy Markdown
Collaborator

@evorowy-jk Can you confirm the problem you're having is with the v3.0 version?
This PR merged into the v3.0 version and released a couple days ago as https://www.nuget.org/packages/MessagePack/3.0.129-beta.

@evorowy-jk

evorowy-jk commented Jul 29, 2024

Copy link
Copy Markdown

Sorry, as I sent the comment I saw that new version has been released - unfortunately on Unity 6, on nuget MessagePack 3.0.129-beta with following MessagePack initialization code:

StaticCompositeResolver.Instance.Register(new[]
{
    MasterMemoryResolver.Instance, 
    UlidMessagePackResolver.Instance,
                    
    StandardResolver.Instance
});

During Runtime on Android (IL2CPP build) there is an error with DynamicAssembly:

Error Unity PlatformNotSupportedException: Operation is not supported on this platform.
Error Unity   at System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly (System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access) [0x00000] in <00000000000000000000000000000000>:0 
Error Unity   at MessagePack.Internal.DynamicAssembly..ctor (System.String moduleName) [0x00000] in <00000000000000000000000000000000>:0 
Error Unity   at MessagePack.Resolvers.DynamicObjectResolver+<>c.<.cctor>b__4_0 () [0x00000] in <00000000000000000000000000000000>:0 
Error Unity   at ListWithEvents`1[T]..ctor () [0x00000] in ./Library/PackageCache/com.unity.addressables/Runtime/ResourceManager/Util/ListWithEvents.cs:8 
Error Unity   at System.Lazy`1[T].ExecutionAndPublication (System.LazyHelper executionAndPublication, System.Boolean useDefaultConstructor) [0x00000] in <00000000000000000000000000000000>:0 

It is somewhat connected with the defines/this issue - should I open new one though?

@AArnott

AArnott commented Jul 29, 2024

Copy link
Copy Markdown
Collaborator

This was referenced Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants