========================= NDK BUILD TROUBLESHOOTING ========================= * gradle clean is not removing any .externalNativeBuild - it removes ./build folder tho Not seeing this: * :app:compileDebugNdk Completed: * :ccc:generateJsonModelDebug * :ccc:generateJsonModelRelease ndk linking issue ================= [ wc_DhCheckPubKey(key, pub, pubSz); (jni_dh.c:274) ] /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_dh.c:274:11: warning: implicit declaration of function 'wc_DhCheckPubKey' is invalid in C99 [-Wimplicit-function-declaration] wc_DhCheckPubKey(key, pub, pubSz); /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_dh.c:274: error: undefined reference to 'wc_DhCheckPubKey' [ length = wc_GetPkcs8TraditionalOffset(k, &offset, kSz); (jni_rsa.c:437:18) ] /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_rsa.c:437:18: warning: implicit declaration of function 'wc_GetPkcs8TraditionalOffset' is invalid in C99 [-Wimplicit-function-declaration] length = wc_GetPkcs8TraditionalOffset(k, &offset, kSz); /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_rsa.c:437: error: undefined reference to 'wc_GetPkcs8TraditionalOffset' FAILURE: Build failed with an exception.o-date * What went wrong: Execution failed for task ':ccc:externalNativeBuildDebug'. > Build command failed. Error while executing process /Users/j3g/apps/android-dev/android-sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/.externalNativeBuild/cmake/debug/x86_64 --target ccc-jni} [1/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_fips.c.o [2/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_native_struct.c.o [3/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_aes.c.o [4/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_des3.c.o [5/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_md5.c.o [6/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_sha.c.o [7/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_rng.c.o [8/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_rsa.c.o [9/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_dh.c.o [10/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_ecc.c.o [11/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_asn.c.o [12/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_logging.c.o [13/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_chacha.c.o [14/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_curve25519.c.o [15/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_ed25519.c.o [16/17] Building C object src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_error.c.o /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_dh.c:274:11: warning: implicit declaration of function 'wc_DhCheckPubKey' is invalid in C99 [-Wimplicit-function-declaration] : wc_DhCheckPubKey(key, pub, pubSz); ^ 1 warning generated. /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_rsa.c:437:18: warning: implicit declaration of function 'wc_GetPkcs8TraditionalOffset' is invalid in C99 [-Wimplicit-function-declaration] length = wc_GetPkcs8TraditionalOffset(k, &offset, kSz); ^ 1 warning generated. [17/17] Linking C shared library ../../../../build/intermediates/cmake/debug/obj/x86_64/libccc-jni.so FAILED: : && /usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=x86_64-none-linux-android23 --gcc-toolchain=/usr/local/opt/android-sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/darwin-x86_64 --sysroot=/usr/local/opt/android-sdk/ndk-bundle/sysroot -fPIC -isystem /usr/local/opt/android-sdk/ndk-bundle/sysroot/usr/include/x86_64-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /usr/local/opt/android-sdk/ndk-bundle/platforms/android-23/arch-x86_64 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/usr/local/opt/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86_64 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libccc-jni.so -o ../../../../build/intermediates/cmake/debug/obj/x86_64/libccc-jni.so src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_fips.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_native_struct.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_aes.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_des3.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_md5.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_sha.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_rng.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_rsa.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_dh.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_ecc.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_asn.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_logging.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_chacha.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_curve25519.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_ed25519.c.o src/main/cpp/wolfcrypt/CMakeFiles/ccc-jni.dir/jni/jni_error.c.o ../../../../dist/lib/x86_64/libwolfssl.a -latomic -lm && : /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_rsa.c:437: error: undefined reference to 'wc_GetPkcs8TraditionalOffset' /Volumes/malloc-dev/nextcrypto/source/nc-wc-ndk_001/ccc/src/main/cpp/wolfcrypt/jni/jni_dh.c:274: error: undefined reference to 'wc_DhCheckPubKey' clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 5s