Method names changes in libstandalonelibwebviewchromium.so after build

120 Views Asked by At

I am using libstandalonelibwebviewchromium.so in my android application and when I am calling a native method it throws "java.lang.UnsatisfiedLinkError: No implementation" . I have looked into this issue and found out that name of the function is different in the library. I have used "nm -gD libstandalonelibwebviewchromium.so" command to list all the methods. For example :

method "org_chromium_base_library_1loader_LibraryLoader_registerNonMainDexJni" changed to "Java_J_N_MIOj213u".

How to configure chromium at the build time to preserve original library method name??

Please help....

Thank You,

Avishek Nath

////////////////////////////////// EDIT /////////////////////////////////

For the Android Chromium source checkout I have followed this link : https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md

  1. I have checked out Chromium source code for Android from github.
  2. Then I ran these commands in ubuntu system
    $ gclient sync
    $ gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default
    $ ninja -C out/Default webview_instrumentation_apk
  3. After these command execution "libstandalonelibwebviewchromium.so" generated in the out/Default folder.

I have taken the libstandalonelibwebviewchromium.so in my project and kept it in the jniLibs folder.

I also ran this "nm -gD libstandalonelibwebviewchromium.so" command which gave a list of symbols but all of them are like "Java_J_N_MIOj213u".

0

There are 0 best solutions below