android - 按执行图像处理的按钮后,我的应用程序崩溃了

标签 android android-studio opencv opencv3.2

我正在创建一个捕获图像并以imageview显示的应用程序。
之后,我使用ORB和匹配进行特征提取。
但是,当我单击下一步按钮时,我的应用程序崩溃了。

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.camscanner, PID: 14872
    java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.features2d.DescriptorMatcher.create_1(int) (tried Java_org_opencv_features2d_DescriptorMatcher_create_11 and Java_org_opencv_features2d_DescriptorMatcher_create_11__I)
        at org.opencv.features2d.DescriptorMatcher.create_1(Native Method)
        at org.opencv.features2d.DescriptorMatcher.create(DescriptorMatcher.java:76)
        at com.example.camscanner.MainActivity$1.onClick(MainActivity.java:101)
        at android.view.View.performClick(View.java:6608)
        at android.view.View.performClickInternal(View.java:6585)
        at android.view.View.access$3100(View.java:785)
        at android.view.View$PerformClick.run(View.java:25921)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
I/Process: Sending signal. PID: 14872 SIG: 9
Process 14872 terminated.

有人知道如何解决此错误吗?

这里gradle文件

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.camscanner"
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags "-frtti -fexceptions"
                abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/'] } }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation project(path: ':scanlibrary')
    implementation project(path: ':openCVLibrary320')
}

如果有人知道如何解决此错误,请发表评论。

最佳答案

我认为这是一个依赖性问题,请尝试转到"file"并选择
无效崩溃/重启
看看是否能解决您的问题。

如果不更改(或更新)您的依赖项

关于android - 按执行图像处理的按钮后,我的应用程序崩溃了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60164527/

相关文章:

c - 安装OpenCV并使用GCC编译C程序

java - Android:创建一个透明盒子,里面有元素

android - 在 Android studio 中创建一个独立的库模块

android - 无法在 Android Studio 中使用 github 库

python - 使用Canny功能时,可以先敷面膜吗?

android - 如何集成 OpenCV 原生库并包含文件到 Android Studio?

android - 如何在我的应用程序关闭之前一直显示我的 Android 通知?

android - 谷歌地图 v2 : to display multiple locations on Google Maps

android - android 8.1.0安装burp证书后报"YOUR CONNECTION IS NOT PRIVATE"错误

android - 工具栏中菜单按钮的颜色