Android JNA UnsatisfiedLinkError: Native library (com/sun/jna/xxx/libjnidispatch.so) not found

后端 未结 1 1857
别那么骄傲
别那么骄傲 2021-01-29 10:06

Hey I am trying to set up a android studio project with JNA and libvirt java bindings.

This is what the project structure looks like so far.

however the soluti

相关标签:
1条回答
  • 2021-01-29 10:36

    Include the libjnidispatch.so shared library for all the Android ABIs that your project supports.

    • Navigate to JNA libraries.
    • Under Version 4.5.0, download the zip archive
    • Unzip the package, navigate to jna-4.5.0/dist/ directory. libjnidispatch.so for different ABIs can be extracted from respective jar file. The mapping is as below illustrated in below table.

      | JNA ABI             | Android ABI   |
      | ------------------- | ------------- |
      | android-aarch64.jar | arm64-v8a     |
      | android-armv7.jar   | armeabi-v7a   |
      | android-x86-64.jar  | x86_64        |
      | android-x86.jar     | x86           |
      
    • Put the libjnidispatch.so into the mapped Android ABI folder, for example, arm64-v8a, armeabi-v7a, x86 and x86_64.
    0 讨论(0)
提交回复
热议问题