I have the same unsolved issue as Fabio in the old forum:
https://answers.opencv.org/question/229811/opencv4android-build-error-with-arm64-v8a/
I built opencv 4.5.1 which works fine for armeabi-v7a but throws a linker error for arm64-v8
[1241/1467] Linking CXX executable bin/opencv_waldboost_detector
FAILED: bin/opencv_waldboost_detector
: && /opt/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/opt/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/opt/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections -Wl,--as-needed modules/xobjdetect/tools/waldboost_detector/CMakeFiles/opencv_waldboost_detector.dir/waldboost_detector.cpp.o -o bin/opencv_waldboost_detector lib/arm64-v8a/libopencv_core.a lib/arm64-v8a/libopencv_imgproc.a lib/arm64-v8a/libopencv_imgcodecs.a lib/arm64-v8a/libopencv_videoio.a lib/arm64-v8a/libopencv_highgui.a lib/arm64-v8a/libopencv_xobjdetect.a lib/arm64-v8a/libopencv_videoio.a -landroid -llog -lmediandk lib/arm64-v8a/libopencv_imgcodecs.a 3rdparty/lib/arm64-v8a/liblibjpeg-turbo.a 3rdparty/lib/arm64-v8a/liblibwebp.a 3rdparty/lib/arm64-v8a/liblibpng.a 3rdparty/lib/arm64-v8a/liblibtiff.a 3rdparty/lib/arm64-v8a/liblibopenjp2.a 3rdparty/lib/arm64-v8a/libIlmImf.a lib/arm64-v8a/libopencv_objdetect.a lib/arm64-v8a/libopencv_calib3d.a lib/arm64-v8a/libopencv_features2d.a lib/arm64-v8a/libopencv_imgproc.a lib/arm64-v8a/libopencv_flann.a lib/arm64-v8a/libopencv_core.a 3rdparty/lib/arm64-v8a/libzlib.a 3rdparty/lib/arm64-v8a/libcpufeatures.a 3rdparty/lib/arm64-v8a/libittnotify.a -ldl -lm -llog 3rdparty/lib/arm64-v8a/libtegra_hal.a 3rdparty/lib/arm64-v8a/libquirc.a -latomic -lm && :
lib/arm64-v8a/libopencv_core.a: error adding symbols: Archive has no index; run ranlib to add one
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
system:
ubuntu 20.10
openJDK 13
opencv 4.5.1 w/ contrib
ndk 21e
android sdk 30
Any ideas?