How to solve "libmain.so not found" while using Unity as a library in Android application with latest AndroidX Versions out of ReactNative

I can answer by myself now. The issue was caused by Unity export that was not ARM64-compatible unless several settings were applied manually. Here is how:

Bevor building for Android, we need to adjust some settings in "Player Settings" in order to make ARM64 available:

  1. Switching "Scripting Backend" from Mono to ILCPP, which enables us to:
  2. Select "ARM64" under Target Architectures

enter image description here

If you run into an Error like "NDK not found" while building, ensure that Unity has downloaded and installed its own copy of NDK:

enter image description here

Having all this in mind will enable us to link against these libraries without failing to find "libmain.so".


Please add following line into your string.xml

<string name="game_view_content_description">Game view</string>

After that add below snippet into your app level's gradle file

defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a', 'x86'
        }
    }

That's it. Enjoy coding!!