java - A/libc:添加 mircroblink 许可证文件时,致命信号 11 (SIGSEGV),代码 1,tid 27503 中的故障地址 0x7d400300
问题描述
所以我有一个项目,其中包含一个 microblink 库,我需要在 MainActivity 中声明它,这里是它的样子
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
/** Set the License from the file*/
MicroblinkSDK.setLicenseFile("this is my license file", this);
}
然后我运行程序并收到错误致命信号,但是当我从 microblink 中删除声明代码时,它可以照常工作。我已经尝试搜索解决方案,它说要添加这个
android:hardwareAccelerated="false"
在清单文件中但失败并且错误没有改变。一些帮助会很好!
这是调试日志
I/art: Do partial code cache collection, code=26KB, data=29KB
I/art: After code cache collection, code=25KB, data=29KB
Increasing code cache capacity to 128KB
I/art: Compiler allocated 6MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
I/art: Do partial code cache collection, code=61KB, data=53KB
After code cache collection, code=61KB, data=53KB
Increasing code cache capacity to 256KB
D/line:110: --- Implementation #2 with key 0x52
D/line:37: Unlocking BlinkID native library version 4.7.0
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x7d400300 in tid 25983 (ana.wandaflpdev)
Disconnected from the target VM, address: 'localhost:50648', transport: 'socket'
解决方案
首先,从日志中,我可以看到您使用的是 4.7 版本,这是 2019 年 2 月发布的 BlinkID 的旧版本。我建议尝试实现最新版本(5.9),您可以在这里下载: https: //github.com/BlinkID/blinkid-android/releases/tag/v5.9.0
Android Application class
此外,关于许可证密钥方法,建议以扩展和设置许可证的方式实现它,onCreate callback
如下所示:
public class MyApplication extends Application {
@Override
public void onCreate() {
MicroblinkSDK.setLicenseFile("path/to/license/file/within/assets/dir", this);
}
}
更多细节在这里: https ://github.com/BlinkID/blinkid-android#performing-your-first-scan
推荐阅读
- html - CSS中角度一致的三角形边
- c# - 应用程序图标保持不变
- date - 如何在使用 Microsoft graph 创建的消息中设置特定日期?
- javascript - 在javascript中从api映射第一个对象
- angular - 如何使用通过 datetimepicker 使用的 angular8 检测 formControl 的 valuechange
- python - 我试图在列表的同一列中组合日期时间和字符串
- chronicle-map - 如果值是一个类,我在创建 ChronicleMap 时为平均值设置什么?[编年史-地图]
- django - AWS 中的 Django 登录
- php - Laravel - 使用范围
- powershell - 尝试使用 Remove-ADGroupMember 时,PowerShell 中的“从服务器返回了引用”