简体   繁体   English

在Android Studio中使用OpenCV Android库时出错

[英]Error using OpenCV Android libs in Android Studio

I've followed this stack overflow answer to try and get OpenCV android working in Android Studio. 我已经按照这个堆栈溢出的答案尝试尝试使OpenCV android在Android Studio中工作。 I have followed the directions with the following caveats: 我按照以下说明进行了说明:

  • The build tools version in the opencv build.gradle is 19.1.0 instead of 19.0.1 opencv build.gradle中的构建工具版本为19.1.0,而不是19.0.1。
  • Instead of looking like the picture provided after a gradle sync, my project structure looks like this: 我的项目结构不是像gradle同步后提供的图片那样,而是:
    在此处输入图片说明
  • When I open the module dialog, opencv appears as a model, as well as app 当我打开模块对话框时,opencv会同时显示为模型和应用程序

The project builds and autocompletes fine. 该项目将生成并自动完成。 However, I get the following error when the code that requires OpenCV is called: 但是,当调用需要OpenCV的代码时,出现以下错误:

    java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.core.Mat.n_Mat:()

I have no idea what I am doing wrong. 我不知道我在做什么错。 Any help is appreciated. 任何帮助表示赞赏。

You have to explicitly load libs with LoadLibrary: 您必须使用LoadLibrary显式加载库:

http://developer.android.com/reference/java/lang/System.html http://developer.android.com/reference/java/lang/System.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM