Crash running Unity (2020.3.27f1 LTS) as library in native Android app

Hi, I am using Unity as a library inside a native Android application.
Currently having some issues trying to upgrade from 2019 to the latest LTS version 2020.3.27f1.
I copied everything from the unity library folder and I see that libil2cpp.so is missing but there are c++ sources to build using gradle.

I managed to build libil2cpp.so but when running the unity player I get this errors:

What is missing from the build?

In the end it was a build problem from my side

1 Like

Hey @AlexDevops ,

What was the build problem your side on this? Iā€™m also facing the same issue with the version 2020.3.34f1 and your fix may be helpful.

Hi @gnayak , when you export the project as Android project it contains some build steps inside the gradle file. If I copy the build steps from gradle file into my project there is something wrong and it does not generate correctly the libil2cpp.so file.
My solution was to do a build using the exported Android project from unity, then take the libil2cpp.so files for all architectures (unityLibrary\src\main\jniLibs\armeabi-v7a\libilcpp.so and unityLibrary\src\main\jniLibs\arm64-v8a\libilcpp.so) and copy into my project