ndk.dir error in Android Studio

前端 未结 3 693
遇见更好的自我
遇见更好的自我 2021-01-24 01:35

I was trying to use opencv library, so I imported one of its projects in Android Studio and when I tried to run it I got this error:

Error:Execution faile

相关标签:
3条回答
  • 2021-01-24 02:17

    OpenCV sample projects haven't support gradle officially. I think it will be easier if you start a new project and configure it to work as in examples. I have implemented a tutorial project using Android Studio + NDK + OpenCV. You may have a look. https://github.com/quanhua92/NDK_OpenCV_AndroidStudio

    0 讨论(0)
  • 2021-01-24 02:17

    Install NDK in your SDK manager, if you already installed open app's "build.gradle" replace these lines

    sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/', 'src/main/jni/'] } }
    

    to

    sourceSets.main { jniLibs.srcDir 'src/main/jniLibs' // mention your JNI lib path(where ".so" files contains) jni.srcDirs = [] //disable automatic ndk-build call }

    I'm tried to configure OpenCV and its fixed

    0 讨论(0)
  • 2021-01-24 02:21

    You need to setup OpenCV librairies for your project. You can follow the instruction here.

    0 讨论(0)
提交回复
热议问题