Cross compiling Couchbase Lite Core for Android armv7 fails

Hi,

I am trying to cross compile CBL core for Android armv7 so far unsuccessfully. I have tried on MacOS as well as Debian and Ubuntu and get the same issues. I have included a short excerpt below. I have been through the docs including the expanded build docs on the wiki and this should be straightforward so I’m sure there is something basic I have missed somewhere.

[ 28%] Building CXX object CMakeFiles/LiteCoreStatic.dir/LiteCore/Database/Database.cc.o [ 28%] Building CXX object vendor/fleece/CMakeFiles/FleeceStatic.dir/Fleece/API_Impl/Fleece.cc.o In file included from /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/API_Impl/Fleece.cc:19: In file included from /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/API_Impl/Fleece+ImplGlue.hh:20: In file included from /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/Core/FleeceImpl.hh:25: /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/Core/Value.hh:55:20: error: default initialization of an object of const type 'const fleece::impl::Null' without a user-provided default constructor constexpr Null nullValue; ^ {} In file included from /home/patrick/development/couchbase-lite-core/LiteCore/Database/Database.cc:27: In file included from /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/Core/FleeceImpl.hh:25: /home/patrick/development/couchbase-lite-core/vendor/fleece/Fleece/Core/Value.hh:55:20: error: default initialization of an object of const type 'const fleece::impl::Null' without a user-provided default constructor constexpr Null nullValue;

Did you try running the build_android.sh included in the couchbase-lite-core repo under build_cmake/scripts ?

Thanks for the very quick response. Yes I did.

This script always works for me, the one caveat is that I have to provide the ANDROID_NDK_ROOT variable first. For example:

ANDROID_NDK_ROOT=/Users/borrrden/Library/Developer/Xamarin/android-ndk/android-ndk-r15c/ bash ./build_android.sh

Same here. I was originally using NDK release 11c as thats what we use here, but I have also tried the latest NDK.

Try using 15c since it is known to work and NDK releases are extremely volatile. Also clean the build directory created between each build.

It works with 15c! Many thanks for your help and getting me sorted so quickly, awesome job. :smiley:

1 Like