【问题标题】:Xamarin Android - couldn't find the .so fileXamarin Android - 找不到 .so 文件
【发布时间】:2018-03-22 17:52:44
【问题描述】:

谁能帮我解决这个问题,下面是错误日志:

java.Lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/hprt_printer_test.hprt_printer_test-1/base.apk"],nativeLibraryDirectories=[/data/app/hprt_printer_test.hprt_printer_test- 1/lib/arm64, /vendor/lib64, /system/lib64]]] 找不到“libhprt_printer_model.so.

我几乎搜索了 StackOverflow 上的所有帖子,但无法解决问题。

基本上,我试图在绑定项目中嵌入一个 jar 文件,然后在我的项目中使用 .dll 文件。对于信息,绑定项目的结构是 the binding project

项目结构如下 The project structure

那么有什么解决办法吗?

谢谢

【问题讨论】:

  • 您是否已将 .so 文件添加到 Xamarin.Android 库项目correctly?
  • 您好,是的,我什至通过编辑 .csproj 文件进行了尝试。

标签: android xamarin


【解决方案1】:

Xamarin 在名为 libs 的特定文件夹中查找您的库 .so 文件。

在您的项目结构中,您有名为 system、vendor 的文件夹。在这些里面你也有 .so 文件。您必须将所有这些放在 libs 文件夹下。

请参考此链接:https://forums.xamarin.com/discussion/106178/how-to-access-dll-or-so-files-in-an-android-project

希望这会有所帮助!

【讨论】:

  • 我忘了提到我正在使用最新平台 Android 8.1 编译项目、jar 绑定和主项目。我没有使用模拟器中的构建,而是使用三星 7。
猜你喜欢
  • 2016-03-04
  • 1970-01-01
  • 2018-08-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多