Lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libmain.so"

Any one could help about lib/arm64, /system/lib64, /vendor/lib64]]] couldn’t find “libmain.so” error. How to fix it ? I submit my game a few days ago and I saw Fatal exception error on Crashlytics console. I switch to build setting to il2cpp and check both ARMv7 and ARM64. To check the lib files I unzipped the apk file and control the folder lib/arm64 and the libmain.so file is in the folder. So I cannot figure it out why I am getting this error. Please help.

1 Like

This happens when application is incorrectly installed, and native libraries are missing. Google should deny such installation, but apparently it still happens.

Is this Google Crash Analytics, if so, where it’s reported - Installed from Play or Installed from Anywhere?

Also please post more information, like device where it happens, Unity version etc.

I submit my game and users installed from play store. I am using Unity 2019.2.11fb and take the build with this version. The error comes from Nexus 5X, Nexus 6P these devices. I take a screen shot of the libs from the unzipped APK. Are all necessary libs installed with APK ?

Here is the crash analytics report
5168600--512819--Ekran Resmi 2019-11-13 01.34.38.png


Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.ctykaya.chessone-fwHedZ8UdsHKv8svbGvy5w==/base.apk”],nativeLibraryDirectories=[/data/app/com.ctykaya.chessone-fwHedZ8UdsHKv8svbGvy5w==/lib/arm64, /system/lib64, /vendor/lib64]]] couldn’t find “libmain.so”
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at com.unity3d.player.UnityPlayer.(:10)
at com.unity3d.player.UnityPlayerActivity.onCreate(:28)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Do you upload app bundle or apk to Google Play, if app bundle, 2019.2.12 might have a fix for you

Android: Fixed an application crash when an application is installed on SD card, and was built using app bundles. Also gradle.properties will now contain a new entry ‘android.bundle.enableUncompressedNativeLibs=false’.

You have the necessary libraries in your apk, but like mentioned in certain conditions, when installing app, none of the native libraries are copied, there’s a bug on Google side.

Thanks Tomas I upload app bundle. I am download the new version of Unity.

Hi, I’m having the problem too with Unity 2019.2.11f1:
Fatal Exception: java.lang.Error
FATAL EXCEPTION [main] Unity version : 2019.2.11f1 Device model : Motorola Motorola One Vision Device fingerprint: google/bullhead/bullhead:5.1/LMY47D/OPM7.181205.001/5080180:userdebug/test-keys
Caused by java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.com.myapp.com/base.apk”],nativeLibraryDirectories=[/data/app/com.myapp.com/lib/arm, /vendor/lib, /system/lib]]] couldn’t find “libmain.so”

I’m using app bundle on playstore.

One more with weird stuff
Fatal Exception: java.lang.Error
FATAL EXCEPTION [main] Unity version : 2019.2.11f1 Device model : Google Pixel Device fingerprint: google/sailfish/sailfish:9/PQ3A.190801.002/5670241:user/release-keys

Caused by java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.myapp.com-MPoD6fIDHPSi4sVkR8wTfg==/base.apk”],nativeLibraryDirectories=[/data/app/com.myapp.com-MPoD6fIDHPSi4sVkR8wTfg==/lib/arm64, /system/lib64, /vendor/lib64]]] couldn’t find “libmain.so”

@Tomas1856 I’m still getting this crash with version 2019.2.12:

Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.myapp.com-1/base.apk”],nativeLibraryDirectories=[/data/app/com.myapp.com-1/lib/arm, /vendor/lib, /system/lib]]] couldn’t find “libmain.so”
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.unity3d.player.UnityPlayer.()
at com.unity3d.player.UnityPlayerActivity.onCreate()
at com.google.firebase.MessagingUnityPlayerActivity.onCreate(MessagingUnityPlayerActivity.java:89)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2371)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2478)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5453)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:671)

Crash happens on a Mi 9X, but only reported through Firebase

Same here on Mi 9X :\

same problem here with older Unity 2018.4.10 - but relatively rare - only one crash logged by Firebase out of around a hundred of beta users… settings are similar to what’s recommended here - react native - How to solve "libmain.so not found" while using Unity as a library in Android application with latest AndroidX Versions out of ReactNative - Stack Overflow

Same issue is still present.

FYI:

  • App Bundle
  • Built with latest 2018 LTS (2018.4.17f1)
  • Crash not (yet) visible in Google Play Console
  • Crashes reported in Firebase Crashlytics
  • Occurs on several brands/types of devices: for this version of our app currently only Motorola One Vision
  • But on a previous version of our app, built with 2018.4.12f1:
  • Samsung Galaxy J3, Wiko Rainbow, JPay JP5s, alps v6, Samsung Galaxy Grand Prime, xiaolajiao LA2-SN, LG L20, Samsung Galaxy Star Plus, Fero A4001 Plus, Lenovo A7-30GC, itel it1516 Plus, Samsung Galaxy J1, and the list goes on and on.
  • Also some crashes on emulators
  • Around 45% of the crashes happen on rooted devices
  • Many versions of Android: from 4.1.1 to 7.1.2

I’ve downloaded some of the generated APKs, specific for the listed devices, via the Google Play Console to check for the presence of the “missing” file ‘libmain.so’.
But it was present in every one of the APKs, so the problem lies elsewhere.

hi there , same as here on samsung A5(2017), can you solve that problem ?!

I think this crashes happen when someone tries to install the bundle manually, not through the store, because I can see some crashes from x86 devices, which are not compatible with my game and the store would never show my app to these users.

FYI Still happening in our latest release using Unity 2018.4.23f1

Still happening in the latest LTS Unity 2018.4.24f1

1 Like

Happened to me. Crash instantly on open

EDIT: I fixed it. Deleted the Assets\Plugins\Android\gradleTemplate.properties and Assets\Plugins\Android\mainTemplate.gradle

Reason of crash: before I deleted those template files, these are the library files that is listed in Android Resolver Dependencies:

<file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-analytics-unity/6.16.1/firebase-analytics-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-analytics-unity/6.16.1/firebase-analytics-unity-6.16.1.pom</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-app-unity/6.16.1/firebase-app-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-app-unity/6.16.1/firebase-app-unity-6.16.1.pom</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-config-unity/6.16.1/firebase-config-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-config-unity/6.16.1/firebase-config-unity-6.16.1.pom</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-crashlytics-unity/6.16.1/firebase-crashlytics-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-crashlytics-unity/6.16.1/firebase-crashlytics-unity-6.16.1.pom</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-instance-id-unity/6.16.1/firebase-instance-id-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-instance-id-unity/6.16.1/firebase-instance-id-unity-6.16.1.pom</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-messaging-unity/6.16.1/firebase-messaging-unity-6.16.1.aar</file>
    <file>Assets/GeneratedLocalRepo/Firebase/m2repository/com/google/firebase/firebase-messaging-unity/6.16.1/firebase-messaging-unity-6.16.1.pom</file>

After I deleted the template files, these are the files that was added to Android Resolver Dependencies:

<file>Assets/Plugins/Android/androidx.annotation.annotation-1.1.0.jar</file>
    <file>Assets/Plugins/Android/androidx.arch.core.core-common-2.0.1.jar</file>
    <file>Assets/Plugins/Android/androidx.arch.core.core-runtime-2.0.1.aar</file>
    <file>Assets/Plugins/Android/androidx.asynclayoutinflater.asynclayoutinflater-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.browser.browser-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.collection.collection-1.0.0.jar</file>
    <file>Assets/Plugins/Android/androidx.coordinatorlayout.coordinatorlayout-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.core.core-1.2.0.aar</file>
    <file>Assets/Plugins/Android/androidx.cursoradapter.cursoradapter-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.customview.customview-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.documentfile.documentfile-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.drawerlayout.drawerlayout-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.fragment.fragment-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.interpolator.interpolator-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-ui-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.legacy.legacy-support-core-utils-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-common-2.0.0.jar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-2.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-livedata-core-2.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-runtime-2.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-service-2.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.lifecycle.lifecycle-viewmodel-2.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.loader.loader-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.localbroadcastmanager.localbroadcastmanager-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.print.print-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.room.room-common-2.1.0.jar</file>
    <file>Assets/Plugins/Android/androidx.room.room-runtime-2.1.0.aar</file>
    <file>Assets/Plugins/Android/androidx.slidingpanelayout.slidingpanelayout-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.sqlite.sqlite-2.0.1.aar</file>
    <file>Assets/Plugins/Android/androidx.sqlite.sqlite-framework-2.0.1.aar</file>
    <file>Assets/Plugins/Android/androidx.swiperefreshlayout.swiperefreshlayout-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.versionedparcelable.versionedparcelable-1.1.0.aar</file>
    <file>Assets/Plugins/Android/androidx.viewpager.viewpager-1.0.0.aar</file>
    <file>Assets/Plugins/Android/androidx.work.work-runtime-2.1.0.aar</file>

So, for some reasons, androidx library wasn’t added which caused the crash

crash log

java.lang.Error: FATAL EXCEPTION [main]
Unity version     : 2019.4.8f1
Device model      : Xiaomi Redmi 4X
Device fingerprint: Xiaomi/santoni/santoni:7.1.2/N2G47H/V11.0.2.0.NAMMIXM:user/release-keys
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.name/base.apk"],nativeLibraryDirectories=[/data/app/com.name/lib/arm64, /data/app/com.name/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libmain.so"
    at java.lang.Runtime.loadLibrary0(Runtime.java:984)
    at java.lang.System.loadLibrary(System.java:1562)
    at com.unity3d.player.UnityPlayer.<clinit>(Unknown Source)
    at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41)
    at com.google.firebase.MessagingUnityPlayerActivity.onCreate(MessagingUnityPlayerActivity.java:91)
    at android.app.Activity.performCreate(Activity.java:6857)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2676)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2784)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1523)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:163)
    at android.app.ActivityThread.main(ActivityThread.java:6238)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)