Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not seem to work with OpenCV 4.9.0 or a bit lower #11

Open
FaizanAhmedSP707 opened this issue Mar 7, 2024 · 1 comment
Open

Does not seem to work with OpenCV 4.9.0 or a bit lower #11

FaizanAhmedSP707 opened this issue Mar 7, 2024 · 1 comment

Comments

@FaizanAhmedSP707
Copy link

I have followed the instructions to start using this project, including changing the location of where you have installed OpenCV, so that the project can find it easily, amongst other things. However, the app refuses to build, and throws out so many errors, mostly relating to Ninja:

Task :app:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/arm64-v8a/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/arm64-v8a/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

Task :app:buildCMakeDebug[armeabi-v7a] FAILED
C/C++: ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/armeabi-v7a/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it

ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/armeabi-v7a/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it

Task :app:buildCMakeDebug[x86] FAILED
C/C++: ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/x86/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/x86/libnative-lib.so', missing and no known rule to make it

ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/x86/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/x86/libnative-lib.so', missing and no known rule to make it

Task :app:buildCMakeDebug[x86_64] FAILED
C/C++: ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/x86_64/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/x86_64/libnative-lib.so', missing and no known rule to make it

ninja: error: 'C:/Users/AhmedWK/Documents/OpenCv-4.9.0/OpenCV-android-sdk/sdk/native/jni/libs/x86_64/libopencv_java4.so', needed by 'D:/USERS_WINDOWS/user_AhmedWk/AndroidProjects/OPENCV_TEST/app/build/intermediates/cxx/Debug/422x5r34/obj/x86_64/libnative-lib.so', missing and no known rule to make it


Furthermore, MainActivity has 8 errors, down from an initial 33 when I first cloned the project, the build output shows the following which I have tried to solve, to no avail:

Task :app:compileDebugKotlin FAILED
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (12, 27): Unresolved reference: BaseLoaderCallback
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (14, 27): Unresolved reference: LoaderCallbackInterface
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (22, 44): Unresolved reference: BaseLoaderCallback
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (23, 9): 'onManagerConnected' overrides nothing
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (25, 17): Unresolved reference: LoaderCallbackInterface
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (34, 27): Unresolved reference: onManagerConnected
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (92, 26): Unresolved reference: initAsync
e: D:\USERS_WINDOWS\user_AhmedWk\AndroidProjects\OPENCV_TEST\app\src\main\kotlin\com\example\nativeopencvandroidtemplate\MainActivity.kt: (95, 48): Unresolved reference: LoaderCallbackInterface

Please advise on what can be done to mitigate this issue. Thanks.

@karczex
Copy link

karczex commented May 20, 2024

OpenCV removed depricated API for OpenCV manager. Any mitigation is to get OpenCV 4.8.1. I don't know why they call it 4.9.0 in stead of 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants