Search Unity

Cannot load 64-bit native library in Android

Discussion in 'Scripting' started by Elisabeth123, Nov 7, 2019.

  1. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    Hi,

    I have the following problem. I want to load a 64-bit native library that is build for arm-v8. It works in an Android application developed in Android Studio, but not in Unity3D.
    I marked all the libaries as Arm64 and put the files in the right folder. Also the APK has the 64 bit libraries in the right folder. But when I load the libary it tells me:

    com.DefaultCompany.TfDebug D/Unity: Unable to lookup library path for 'libtflite', native render plugin support disabled.
    2019-11-07 22:56:53.142 3815-3846/com.DefaultCompany.TfDebug E/Unity: Unable to find libtflite

    Can anyone help me with this? btw: 32-bit libraries are working fine, but none of my 64-bit libraries are found.

    BR, Elisabeth
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,726
    I actually haven't gotten this working yet either in 64bit. I lack access to 64bit test hardware to test right now, but the one attempt I made to build Android 64bit with my native package included did not mount the library correctly.

    I did notice a blurb in this page and it did not make sense:

    https://docs.unity3d.com/Manual/AndroidNativePlugins.html

    See near the bottom. I'll screencap it here:
    Screen Shot 2019-11-07 at 5.29.22 PM.png

    What is the distinction between those two types of decorator? I used the first (as I did in the past with 32-bit IL2CPP... my native C++ stuff is compiled as an AAR using the NDK) and that didn't work. I have not yet had a chance to retry with the "__Internal" argument.
     
  3. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    Hi, thanks for the reply, but in my case I only have a .so file and not class file, therefore DllImport("pluginName") is the way to go.
     
  4. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    ok solved it --> in Unity 2020 it works, in 2019 not
     
    Kurt-Dekker likes this.