首页 > 解决方案 > 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'

标签: javaandroidfatal-errormicroblink

解决方案


首先,从日志中,我可以看到您使用的是 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


推荐阅读