Android Spatialite 中 jsqlite.Database.internal_init 中的 java.lang.UnsatisfiedLinkError [英] java.lang.UnsatisfiedLinkError in jsqlite.Database.internal_init in Android Spatialite

查看:38
本文介绍了Android Spatialite 中 jsqlite.Database.internal_init 中的 java.lang.UnsatisfiedLinkError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是为 Android 开发和使用 Spatialite 的新手,不知道为什么我的应用会因为这个错误而在一些设备上崩溃:

I'm new to developing for Android and using Spatialite and can't figure out why my app is crashing on a few devices because of this error:

java.lang.UnsatisfiedLinkError: No implementation found for void jsqlite.Database.internal_init() (试过 Java_jsqlite_Database_internal_1init 和 Java_jsqlite_Database_internal_1init__)在 jsqlite.Database.internal_init(本机方法)在 jsqlite.Database.(Database.java:25)

java.lang.UnsatisfiedLinkError: No implementation found for void jsqlite.Database.internal_init() (tried Java_jsqlite_Database_internal_1init and Java_jsqlite_Database_internal_1init__) at jsqlite.Database.internal_init(Native Method) at jsqlite.Database.(Database.java:25)

此崩溃报告来自搭载 Android 6.0 的 Nexus 5(锤头),但在搭载 Android 4.1 的 Xoom 和一些其他未知设备上也有报告.我认为这可能与这些问题中提到的 NDK 版本有关:

This crash report is from a Nexus 5 (hammerhead) with Android 6.0 but it's been reported on Xoom with Android 4.1 and a few other unknown devices. I think it maybe be related to NDK versions as mentioned in these issues:

添加.so"库到我的 android studio 项目
Android NDK java.lang.UnsatisfiedLinkError: findLibrary 返回 nullhttps://bitbucket.org/almworks/sqlite4java/issues/71/arm64-位.(虽然这是针对 sqlite4java 的)

Adding ".so" library to my android studio project
Android NDK java.lang.UnsatisfiedLinkError: findLibrary returned null https://bitbucket.org/almworks/sqlite4java/issues/71/arm64-bit. (although this is for sqlite4java)

除此之外,我还收到此错误/警告(取决于设备):libjsqlite.so 具有文本重定位.这会浪费内存并防止安全加固.请修复.虽然它不会像其他错误那样使应用程序崩溃.

Other than that I'm also getting this error/warning (depending on the device): libjsqlite.so has text relocations. This is wasting memory and prevents security hardening. Please fix. Although it doesnt crash the app like the other error.

推荐答案

我通过在应用程序 built.gradle(或 AndroidManifest.xml)中设置解决了这个问题:

I solved it by setting in the app built.gradle (or in the AndroidManifest.xml) this:

targetSdkVersion 21

而且它有效!我知道这不是一个好的解决方案,它是一个补丁,但我可以工作!

And it works! I know that it isn't a good solution, it's a patch, but i works!

***更新

如果无法将目标版本更改为 21,可以执行以下操作:

If you can't change the target version to 21, you can do the following:

  • 从以下网址下载源代码:https://github.com/geopaparazzi/geopaparazzi
  • 清除项目中对 spatialite、.war 文件和 jndi 库的所有引用
  • 复制模块geopaparazzispatialitelibrary并集成到您的项目中
  • 从模块中清除不需要的代码
  • 编译并享受您的项目目标版本 23

这是一个有点复杂的过程,但它有效.

It's a bit complex process, but it works.

特别感谢 andrea antonello,他帮助我解决了这个问题,并且在 spatialite 方面做得很好.

Expecially thanks to andrea antonello, he help me to solve the problem, and do a great job with spatialite.

这篇关于Android Spatialite 中 jsqlite.Database.internal_init 中的 java.lang.UnsatisfiedLinkError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆