question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unity 2022.2.1f1 IL2CPP Compile Error - System.Text.Json no viable overloaded '=' for ValueTask

See original GitHub issue

Version

6.2.5

Details

getting an IL2CPP compile time exception related to System.Text.Json 6.0.6

Cmdline: "K:/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++" -march=armv7-a -mfloat-abi=softfp -mfpu=neon-fp16 -marm -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__ANDROID_API__=22 -DANDROID -DHAVE_INTTYPES_H -no-canonical-prefixes -funwind-tables -fstack-protector -std=c++11 -Wswitch -Wno-trigraphs -Wno-tautological-compare -Wno-invalid-offsetof -Wno-implicitly-unsigned-literal -Wno-integer-overflow -Wno-shift-negative-value -Wno-unknown-attributes -Wno-implicit-function-declaration -Wno-null-conversion -Wno-missing-declarations -Wno-unused-value -Wno-pragma-once-outside-header -fvisibility=hidden -fexceptions -fno-rtti -g -O0 -fPIC -fno-strict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -D_GLIBCXX_USE_CXX11_ABI=0 -DBASELIB_INLINE_NAMESPACE=il2cpp_baselib -DIL2CPP_MONO_DEBUGGER=1 -DRUNTIME_IL2CPP -DIL2CPP_ENABLE_WRITE_BARRIERS=1 -DIL2CPP_INCREMENTAL_TIME_SLICE=3 -DIL2CPP_DEBUG=1 -DIL2CPP_DEBUGGER_PORT=56000 -DHAVE_BDWGC_GC -D_DEBUG -I"." -I"K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput" -I"K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp/pch" -I"K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/libil2cpp" -I"K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/baselib/Include" -I"K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/IL2CPP/external/baselib/Platforms/Android/Include" -o "q8q9/7ukczhykxhhu.o" -fcolor-diagnostics -fdiagnostics-absolute-paths -target armv7a-linux-androideabi22 -fdiagnostics-format=msvc -c -x c++ "K:/Code/Nreal-Unity-Demos/Android/unityLibrary/src/main/Il2CppOutputProject/Source/il2cppOutput/System.Text.Json3.cpp"
ExitCode: 1
Stdout: 
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(11890,11): error: no viable overloaded '='
                                                V_3 = L_12;
                                                ~~~ ^ ~~~~
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(2765,8): note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F' to 'const ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' for 1st argument
struct ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711 
       ^
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(2765,8): note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F' to 'ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' for 1st argument
struct ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711 
       ^
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(12417,9): error: no viable overloaded '='
                                V_4 = L_8;
                                ~~~ ^ ~~~
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(2765,8): note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F' to 'const ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' for 1st argument
struct ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711 
       ^
K:\Code\Nreal-Unity-Demos\Android\unityLibrary\src\main\Il2CppOutputProject\Source\il2cppOutput\System.Text.Json3.cpp(2765,8): note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'ValueTask_t10B4B5DDF5C582607D0E634FA912F8CB94FCD49F' to 'ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711' for 1st argument
struct ValueTask_tD1A250CC105307FE5FB0D9D930345BB719E6B711 
       ^
2 errors generated.

Steps to reproduce

  1. Clone this sample-project: https://github.com/ryanhlewis/unity-youtube-explode/tree/sample-project (make sure to check out the sample-project branch)
  2. open the project in Unity 2022.2.1f1 (targeting android)
  3. attempt to build the project for android
  4. See compiler error

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
adenekcommented, Jan 14, 2023

YoutubeExplode do work well in unity for android but you need to do a bit of workaround.

  1. Install nuget for unity (https://github.com/GlitchEnzo/NuGetForUnity)
  2. Install youtube explode and the dependency via nuget
  3. Remove dependency that already exist in unity (will have a report of that in the console)
  4. Close unity and add this dependencie to your Packages/manifest.json “com.system-community.systemruntimecompilerservicesunsafe”: “https://github.com/system-community/SystemRuntimeCompilerServicesUnsafe.git?path=Assets/_Root#6.0.0
  5. Move all YoutubeExplode and dependencies dll to a Plugins folder
  6. Add a link.xml document to avoid striping of the dll for example mine look like that:
<linker> <assembly fullname="YoutubeExplode" preserve="all"/> <assembly fullname="AngleSharp" preserve="all"/> <assembly fullname="Microsoft.Bcl.AsyncInterfaces" preserve="all"/> <assembly fullname="System.Text.Encodings.Web" preserve="all"/> <assembly fullname="System.Text.Json" preserve="all"/> </linker> 8. Make sure you using Unity 2022+ 7. Restart unity and compile

After that all work 😃 Thx again for this amazing library

1reaction
jakedownscommented, Jan 18, 2023

That sounds like a Unity bug to me. I don’t have any plans to switch to Newtonsoft.Json. If libvideo works for you, why not use that instead?

yeah i’m just gonna use it for now.

thanks for a great library / the feedback

BTW, your package appears to have easier streaming support, at least when paired with libvlc/libvlcsharp/vlc-for-unity

libvideo seems like a download-only library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity 2022.2.1f1 - System.Text.Json "no viable overloaded ' ...
Description. Attempting to use System.Text.Json.6.0.6 in my Unity 2022.2.1f1 project. the project compiles fine with the Mono scripting backend,
Read more >
IL2CPP System.Text.Json no viable overloaded '=' ValueTask
in my project, I'm attempting to integrate YoutubeExplode GitHub - Tyrrrz/YoutubeExplode: Abstraction layer over YouTube's internal API when ...
Read more >
Questions in topic: "il2cpp"
Next IL2CPP Build error for android (2022.2.1f1) ... Text.Json no viable overloaded '=' ValueTask. Previous IL2CPP Build error for android (2022.2.1f1).
Read more >
[Backport] Build fails with IL2CPP error ... - Unity Issue Tracker
Actual result: project build failed with the error "IL2CPP error (no further information about what managed code was being converted is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found