Reputation: 71
I am building an Android application using Android.mk
file. I will call this application as A1.
I am given a third party native library in the form of .so
file that has Utility functions. I will call this library as N1. N1 is built on Android studio by the third party vendor.
When I include N1 in A1 and try to build A1 using Android.mk
, the compilation fails due to symbol mismatch error.
When I checked about the symbol mismatch, here is the difference:
a. Sample Symbol generated by Android Studio:
_ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm
b. Same symbol generated by Android.mk
using the header files of N1 that is present in A1:
_ZNSt6__basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm
The difference is, N1 has 'ndk112
' added in each of its symbol. This can be seen if we open the .so
file in Notepad++.
I searched a lot to check of there are any flags that can be used to fix this issue, but couldn't get any reference. Can someone help me in removing 'ndk112
' from the symbols of a .so
file generated using Android Studio.
Upvotes: 1
Views: 585
Reputation: 10509
Same cause as https://stackoverflow.com/a/38798556/632035. N1 and A1 are using different STLs. They must use the same STL. You need to have A1 rebuilt with libc++.
Upvotes: 1