How to add native OpenCV in Android Studio 3.1.2?

前端 未结 1 1515
花落未央
花落未央 2021-02-06 18:22

My Android Studio version is 3.1.2, Java version is 1.8

I use following step to add OpenCV to project

  1. Create new project and checked \"Include C++ suppo

1条回答
  •  醉话见心
    2021-02-06 19:00

    This problem is being tracked on OpenCV GitHub: OpenCV doesn't link on Android x86/x86_64 with ndk 16.0.4442984 with R_386_GOTOFF error (closed).

    TL;NR: the prebuilt binaries of OpenCV-android-sdk, and in particular the x86/libippicv.a, is not compatible with the latest NDK r16. The easiest workaround is to use an older NDK version. If you cannot, the patch which excludes libippicv.a should do the job:

    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a")
    

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