Issue 1:
System information (version)

OpenCV => 3.4.2

Operating System / Platform => Windows10

Compiler => android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe (ver 3.8)

Detailed description

configure using cmake-gui

default build pass, failed with following configuration

CPU/HW features:
Baseline: VFPV3 NEON
requested: DETECT
required: NEON VFPV3

General configuration for OpenCV 3.4.2 =====================================
Version control: unknown

Platform:
Timestamp: 2018-08-27T03:39:44Z
Host: Windows 10.0.17134 AMD64
Target: Android 1 armv7-a
CMake: 3.11.2
CMake generator: MinGW Makefiles
CMake build tool: C:/msys64/mingw64/bin/mingw32-make.exe
Configuration: Release

CPU/HW features:
Baseline: VFPV3 NEON
requested: DETECT
required: NEON VFPV3

C/C++:
Built as dynamic libs?: NO
C++11: YES
C++ Compiler: D:/software/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe (ver 3.8)
C++ flags (Release): -isystem D:/software/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -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 -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -Os -DNDEBUG -DNDEBUG
C++ flags (Debug): -isystem D:/software/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -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 -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -DDEBUG -D_DEBUG
C Compiler: D:/software/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
C flags (Release): -isystem D:/software/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -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 -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -Os -DNDEBUG -DNDEBUG
C flags (Debug): -isystem D:/software/android-sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -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 -Winit-self -Winconsistent-missing-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot D:/software/android-sdk/ndk-bundle/platforms/android-14/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -LD:/software/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now
Linker flags (Debug): -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot D:/software/android-sdk/ndk-bundle/platforms/android-14/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -LD:/software/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now
ccache: NO
Precompiled headers: NO
Extra dependencies: z dl m log
3rdparty dependencies: libprotobuf libjpeg-turbo libwebp libpng libtiff libjasper IlmImf libcpufeatures tegra_hal

OpenCV modules:
To be built: calib3d core dnn features2d flann highgui imgcodecs imgproc java_bindings_generator ml objdetect photo python_bindings_generator shape stitching superres video videostab world
Disabled: js videoio
Disabled by dependency: ts
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
Applications: -
Documentation: NO
Non-free algorithms: NO

Android NDK: D:/software/android-sdk/ndk-bundle (ver 17.1.4828580)
Android ABI: armeabi-v7a
NDK toolchain: arm-linux-androideabi-clang
STL type: c++_static
Native API level: 14
Android SDK: not used, projects are not built

GUI:

Media I/O:
ZLib: z (ver 1.2.3)
JPEG: build-libjpeg-turbo (ver 1.5.3-62)
WEBP: build (ver encoder: 0x020e)
PNG: build (ver 1.6.34)
TIFF: build (ver 42 - 4.0.9)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES

Video I/O:

Parallel framework: pthreads

Trace: YES (built-in)

Other third-party libraries:
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.5.1)

Python (for build): NO

Java: export all functions
ant: NO
Java wrappers: NO
Java tests: NO

Steps to reproduce

run

make

build result stop at

[ 30%] Building ASM object 3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_sub4_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:65:1: note: while in macro instantiation
func png_read_filter_row_sub4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:79:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_sub3_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:81:1: note: while in macro instantiation
func png_read_filter_row_sub3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:105:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_up_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:107:1: note: while in macro instantiation
func png_read_filter_row_up_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:118:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_avg4_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:120:1: note: while in macro instantiation
func png_read_filter_row_avg4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:139:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_avg3_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:141:1: note: while in macro instantiation
func png_read_filter_row_avg3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:174:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_paeth4_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:192:1: note: while in macro instantiation
func png_read_filter_row_paeth4_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:213:1: note: while in macro instantiation
endfunc
^
<instantiation>:18:9: error: unknown directive
.func png_read_filter_row_paeth3_neon
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:215:1: note: while in macro instantiation
func png_read_filter_row_paeth3_neon, export=1
^
<instantiation>:2:9: error: unknown directive
.endfunc
^
C:\\Users\\user\\Downloads\\opencv-3.4.2\\3rdparty\\libpng\\arm\\filter_neon.S:250:1: note: while in macro instantiation
endfunc
^
make[2]: *** [3rdparty\libpng\CMakeFiles\libpng.dir\build.make:270: 3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o] Error 1
make[1]: *** [CMakeFiles\Makefile2:557: 3rdparty/libpng/CMakeFiles/libpng.dir/all] Error 2
make: *** [Makefile:162: all] Error 2

Issue 2:
System information (version)

OpenCV => 4.0.1:

Operating System / Platform => Android 8.0 armeabi-v7a:

Compiler => ❔ clang NDK 19, 18, 17, 16

Detailed description

I am trying to use opencv-4.0.1-android-sdk.zip in latest Android studio. For Armv8 everything is ok. Armv7 crashes when I am trying to call compute function.

Maybe I need any special arguments in build.gradle file with Armv7 build?

I tried NDK 19, 18, 17, 16, and "-DANDROID_STL=c++_shared" flags, it does not helps.

Here is Logcat:

signal 7 (SIGBUS), code 1 (BUS_ADRALN)

...

/lib/arm/libopencv_java4.so (_ZN2cv3hal11sepFilter2DEiiiPhjS1_jiiiiiiS1_iS1_iiidi+474)

/lib/arm/libopencv_java4.so (_ZN2cv11sepFilter2DERKNS_11_InputArrayERKNS_12_OutputArrayEiS2_S2_NS_6Point_IiEEdi+428)

/lib/arm/libopencv_java4.so (_ZN2cv12GaussianBlurERKNS_11_InputArrayERKNS_12_OutputArrayENS_5Size_IiEEddi+432)

/lib/arm/libopencv_java4.so

/lib/arm/libopencv_java4.so (_ZN2cv9Feature2D7computeERKNS_11_InputArrayERNSt6__ndk16vectorINS_8KeyPointENS4_9allocatorIS6_EEEERKNS_12_OutputArrayE+76)

...

Steps to reproduce

call Feature2D.compute or cv::buildOpticalFlowPyramid