Hello. We have an error at the il2cpp build stage (Unity UWP platform):
error C2679: binary '=': no operator found which takes a right-hand operand of type 'ValueTask_1_t55FBC899EA1E61F4DB1850AF34C9F4470F6DF24E' (or there is no acceptable conversion)
Our research has led to the fact that the error is in the build of the System.IO.Pipelines namespace.
Everything builds perfectly on all other platforms: Android, IOS, Standalone. The problem is only with UWP.
How to solve it?
An empty project with only code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO.Pipelines;
using System.IO;
using System;
using System.Threading.Tasks;
public class App : MonoBehaviour
{
private readonly Pipe _pipeRequest;
private readonly Pipe _pipeResponse;
public Pipe RequestPipe => _pipeRequest;
public Pipe ResponsePipe => _pipeResponse;
// Start is called before the first frame update
void Start()
{
_ = RequestAbortedAsync();
}
public async Task RequestAbortedAsync(Exception e = default)
{
await RequestPipe.Reader.CompleteAsync(new IOException("The request was aborted.")).ConfigureAwait(false);
await ResponsePipe.Writer.CompleteAsync(new IOException("The request was aborted.")).ConfigureAwait(false);
}
// Update is called once per frame
void Update()
{
}
}
leeds to errors on il2cpp build stage:
1>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Assembly-CSharp.cpp
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1143): error C2679: binary '=': no operator found which takes a right-hand operand of type 'ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' (or there is no acceptable conversion)
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(474): note: could be 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F::operator =(ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &&)'
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(474): note: or 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F::operator =(const ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &)'
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1143): note: while trying to match the argument list '(ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F, ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711)'
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1197): error C2679: binary '=': no operator found which takes a right-hand operand of type 'ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' (or there is no acceptable conversion)
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(474): note: could be 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F::operator =(ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &&)'
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(474): note: or 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F::operator =(const ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F &)'
1>D:\temp\WsaBuild\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1197): note: while trying to match the argument list '(ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F, ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711)'
This looks like it is a bug on the Unity side. Can you submit a bug report and send me the bug report number? Unity QA: Building quality with passion
@JoshPeterson
https://unity3d.atlassian.net/servicedesk/customer/portal/2/IN-17096
Submitted bug report.
Can you advice something? Our release is on fire because of this bug.
All other pltaforms compiled il2cpp project fine. May be some custom settings? Why only uwp pltaform errors exist?
The problem while trying to compile microsoft code that using ValueTask type. Such as IAsyncDisposable.
It looks like this is corrected with the latest code we have in Unity, as I’m not able to reproduce the problem. I’m unsure yet when it was fixed, but I’m trying to track that down now to see when it will be in a 2021 Unity release.
I’m having trouble reproducing it, even in the 2021.3.9 version of Unity.
Looking at the project, you may want to try to remove the assemblies in the Plugins\System directory. With Unity 2021.3, we have support for .NET Standard 2.1, so I don’t think you will need the System.Theading.Tasks.Extensions.dll assembly.
There may be a conflict here where types are coming both from that assembly and from assemblies shipped with the base class library.
@JoshPeterson Oh, thank you very much!!! We removed System.Theading.Tasks.Extensions.dll and the code above was built.
But some other errors occurs on modified code:
var result = await reader.ReadAsync(CancellationToken.None);
ReadOnlySequence<byte> buf = result.Buffer;
1>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Assembly-CSharp.cpp
1>D:\temp\BUILD\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1698): error C2679: binary '=': no operator found which takes a right-hand operand of type 'ReadOnlySequence_1_t38998D05CBF65F5F510360A9312CCD3791C56F06' (or there is no acceptable conversion)
1>D:\temp\BUILD\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(415): note: could be 'ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A &ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A::operator =(ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A &&)'
1>D:\temp\BUILD\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(415): note: or 'ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A &ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A::operator =(const ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A &)'
1>D:\temp\BUILD\Il2CppOutputProject\Source\il2cppOutput\Assembly-CSharp.cpp(1698): note: while trying to match the argument list '(ReadOnlySequence_1_t85097489C00952FC58DF9F3ACE926EAE9A51898A, ReadOnlySequence_1_t38998D05CBF65F5F510360A9312CCD3791C56F06)'
1>
// ReadOnlySequence<byte> buf = result.Buffer;
ReadOnlySequence_1_t38998D05CBF65F5F510360A9312CCD3791C56F06 L_17;
L_17 = ReadResult_get_Buffer_m1C128DB0A796549CF40ECB3ADDEEBE7DFB93D45E_inline((&V_2), NULL);
V_3 = L_17;
Bug report: Jira Service Management
Great! It looks like there is a System.Memory.dll file in that directory as well. I suspect the ReadOnlySequence from that is conflicting with something from the base class libraries. Maybe try to remove that assembly also.
@JoshPeterson Unfortunately, System.io.pipelines.dll refers to her.
Error: type `System.Buffers.ReadOnlySequenceSegment`1` doesn't exist in target framework. It is referenced from System.IO.Pipelines.dll at System.IO.Pipelines.BufferSegment.
Error: type `System.Buffers.IMemoryOwner`1` doesn't exist in target framework. It is referenced from System.IO.Pipelines.dll at System.IO.Pipelines.BufferSegment.
Error: type `System.Buffers.ReadOnlySequenceSegment`1` doesn't exist in target framework. It is referenced from System.IO.Pipelines.dll at System.Void System.IO.Pipelines.BufferSegment::set_End(System.Int32).
Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
� Unity.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
� Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
� Mono.Cecil.MetadataResolver.Resolve(MethodReference method)
� Mono.Cecil.MethodReference.Resolve()
� Unity.ReferenceRewriter.RewriteTypeReferences.Visit(MethodReference method, String referencingEntityName)
� Unity.ReferenceRewriter.ReferenceDispatcher.Visit(MethodReference method, String referencingEntityName)
� Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethodBody(MethodBody body)
� Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethod(MethodDefinition method)
� Unity.ReferenceRewriter.ReferenceDispatcher.DispatchMethods(TypeDefinition type)
� Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch()
� Unity.ReferenceRewriter.RewriteTypeReferences.Run()
� Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
� Unity.ReferenceRewriter.Program.Main(String[] args)
Where is this System.IO.Pipelines package from? Are these assemblies copied from NuGet? If so, I wonder if this is the package made to work with .NET Standard 2.0. Maybe try the NuGet package built against .NET Standard 2.1, if it exists.
@JoshPeterson thank you very much. All is done. Deleted some conflicting files.
1 Like