因此,我有一个包含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'发布于 2021-01-14 23:19:41
首先,从日志中可以看到,您使用的是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
https://stackoverflow.com/questions/65695070
复制相似问题