Importing multiple functions in an Android plugin.

Hi all,

I am crashing on Android when trying to import two functions from a single Shared Object library that I made (there is no Java code, just C++). Like so:

[DllImport("loremipsum")]
private static extern int _Init(IntPtr data, uint dataLength);
[DllImport("loremipsum")]
private static extern float _Analyze();

I get the following error from logcat when trying to run this code on device:

D/dalvikvm( 1785): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
D/dalvikvm( 1785): Added shared lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
D/dalvikvm( 1785): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
D/dalvikvm( 1785): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libloremipsum.so' already loaded in same CL 0x40744ac0
I/DEBUG   (   80): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (   80): Build fingerprint: 'acer/picasso_comgen2/picasso:3.1/HMJ37/1309327721:user/release-keys'
*** CRASH MEMORY DUMP ***

It works fine if I comment out either one of the imports and the associated function prototype. Is there something I’m doing wrong here? I know it’s of little significance, but I use something similar to this on my iOS build and it’s fine.

Thank you for your help.

I’m trying to get scaleform to work on Android and I also get the same issue. Can anyone tell me whether this is a Unity issue or a plugin issue?

here is my code.

[DllImport("gfxunity3d")]
public static extern void UnityRenderEvent(int id);
	
[DllImport("gfxunity3d")]
private static extern void SF_Uninit();

this is the error log I get when I tried running it on my android device

D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700

D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700

D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700

D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700

D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700

D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700

Thanks for your help