I have a Android application which i compiled with AOSP(Kitkat) as android system application and it was running fine. My application is dependent on native code compiled with Android-NDK as 32 bit libraries. I am copying native libraries inside my android applications libs/armeabi folder and then building my android application in AOSP(I have also modified device.mk to copy my libs in the /system/lib folder). Everything is working fine on Android Kitkat.
When i ported my application on Android-L(64bit platform) then i am not able to load my native libraries from Android application and error is like -
java.lang.UnsatisfiedLinkError: dlopen failed: "libfoobar.so" is 32-bit instead of 64-bit
I am using following java code to load native library-
if ( ENABLE_ANDROID_INTEGRATION )
{
System.load("/system/lib/libfoobar.so");
}
else
{
System.loadLibrary("foobar");
}
When i am building my code with AOSP then ENABLE_ANDROID_INTEGRATION is true
More interestingly when i turned off ENABLE_ANDROID_INTEGRATION and build my application in Eclipse, outside AOSP as a normal "downloadable" application then my application is running fine on 64bit Android platform.
What i want to know - how can i build my application as a native android system application with 32 bit libraries(that means AOSP build) for 64 bit Android platform?
What i have tried - I used LOCAL_32_BIT_ONLY = true flag in my android application's Android.mk file, but it seams it is not useful. May be i am not fully aware of this flag use.
As i am running out of time so i preferred to post this question here in group instead of RnD. If anyone faced this problem then please guide.
Regards,
Meraj
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…