Compiled library for Unity

Hello Everyone,

Is .a or .dylib libraries compiled in xcode are allowed to be integrated in android?
Im having a problem in integrating my plugin named libJavaBridge.a( also tried the .dylib version but fails to work ) but unity fails to read it during runtime. What I’ve read on the documentation, unity supports .so library but i don’t know what c compiler should I used to be able to compile it correctly.

Here is what I got during import process of library inside the game.

01-23 22:16:39.233: DEBUG/Unity(19146): DllNotFoundException: JavaBridge
01-23 22:16:39.233: DEBUG/Unity(19146): at (wrapper managed-to-native) CubeObject:SetScreenIndex (int)
01-23 22:16:39.233: DEBUG/Unity(19146): at CubeObject.OnSnapped (Single pCurrentRot) [0x00000] in :0
01-23 22:16:39.233: DEBUG/Unity(19146): at CubeObject.FixedUpdate () [0x00000] in :0

Here is the script inside the c#:

The function who calls inside the script:

[DllImport(“JavaBridge”)]
** private static extern void SetScreenIndex( int pIndex );**

I hope there is someone who could help me.
Any answers are much appreciated!

Thanks in advance!:):slight_smile:

Dynamic librarys for android need to be built with NDK and will have the file extension .so (as all dynamic libraries on linux).
Static libraries are not supported for DLLImport

You can check out the plugin documentation of U3, more specifically the android foldout, for more information

Thanks dreamora!