Search Unity

Question libmain issues when integrating Unity as a library in Apache Cordova project

Discussion in 'Android' started by Robbert1994, Dec 3, 2020.

  1. Robbert1994

    Robbert1994

    Joined:
    Dec 2, 2020
    Posts:
    1
    Hey all,

    I have been trying to integrate Unity into my Apache Cordova project. I know that Unity as a Library is mainly used for Native applications.
    I have tried to integrate Unity as a Library in my plugin to then build and run the application.
    I have also tried to integrate Unity as a Library in my already build Android application. For this integration I have used the example given in https://forum.unity.com/threads/int...brary-in-native-android-app-version-2.751712/ which works on its own when I tried.

    The issue I am running into with both tries is libmain.so not being found.
    Process: cordova.robbert.cordovaplugin:Unity, PID: 8663
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libmain.so" not found
    at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
    at java.lang.System.loadLibrary(System.java:1664)
    at com.unity3d.player.UnityPlayer.<clinit>(Unknown Source:13)
    at com.unity3d.player.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:41)
    at com.robbert.plugin.OverrideUnityActivity.onCreate(OverrideUnityActivity.java:16)
    at com.robbert.plugin.MainUnityActivity.onCreate(MainUnityActivity.java:16)
    at android.app.Activity.performCreate(Activity.java:8000)
    at android.app.Activity.performCreate(Activity.java:7984)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

    I have also tried to build the unity project with ARM64 enabled as described here: https://stackoverflow.com/questions/58877735/how-to-solve-libmain-so-not-found-while-using-unity-as-a-library-in-android-ap

    The eventual goal of this project is to get Augmented Reality working on an Apache Cordova project.

    Any help would be appreciated. If there is anything else you need in order to help me solve this issue let me know.

    Robbert
     
    Last edited: Dec 3, 2020
    ZoiX likes this.