ConnectivityManager. TooManyRequestsException

Hi,

I’m using couchbase lite 2.7.0 in my android app. This below error making my app crash. Can anyone help me out.

android.net.ConnectivityManager$TooManyRequestsException: null
    at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:3970)
    at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4159)
    at android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4688)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4655)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4629)
    at androidx.work.impl.constraints.trackers.NetworkStateTracker.startTracking(NetworkStateTracker.java:89)
    at androidx.work.impl.constraints.trackers.ConstraintTracker.addListener(ConstraintTracker.java:71)
    at androidx.work.impl.constraints.controllers.ConstraintController.replace(ConstraintController.java:99)
    at androidx.work.impl.constraints.WorkConstraintsTracker.replace(WorkConstraintsTracker.java:106)
    at androidx.work.impl.background.greedy.GreedyScheduler.schedule(GreedyScheduler.java:157)
    at androidx.work.impl.background.greedy.DelayedWorkTracker$1.run(DelayedWorkTracker.java:75)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8680)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Do you have any evidence that this has anything to do with Couchbase? The exception looks like a WorkManager callback…

Hi @blake.meike Can you verify below log it seems same as above,

android.net.ConnectivityManager$TooManyRequestsException: null
    at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:3970)
    at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4159)
    at android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4688)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4655)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4629)
    at com.couchbase.lite.internal.AndroidConnectivityManager$ConnectivityListenerPost28.start(AndroidConnectivityManager.java:245)
    at com.couchbase.lite.internal.AndroidConnectivityManager.start(AndroidConnectivityManager.java:345)
    at com.couchbase.lite.internal.AndroidConnectivityManager.registerObserver(AndroidConnectivityManager.java:299)
    at com.couchbase.lite.internal.replicator.AndroidConnectivityObserver.handleOffline(AndroidConnectivityObserver.java:57)
    at com.couchbase.lite.Replicator.handleOffline(Replicator.java:86)
    at com.couchbase.lite.AbstractReplicator.c4StatusChanged(AbstractReplicator.java:743)
    at com.couchbase.lite.AbstractReplicator$ReplicatorListener.lambda$statusChanged$0(AbstractReplicator.java:255)
    at com.couchbase.lite.-$$Lambda$AbstractReplicator$ReplicatorListener$K9fvruo4ys5Od7V8e4M_8F5AQzk.run
    at com.couchbase.lite.internal.AbstractExecutionService$InstrumentedTask.run(AbstractExecutionService.java:94)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)

No, this log is entirely different from the one you posted previously.

There is no way I will have any chance of figuring out what is going on, with only this much information. If you can get me some debug level logging for 30seconds or so, around the time of the failure, I can try to help.

The interesting part is we are seeing lot of errors with this stacktrace in our error tracking tool in production but not able to reproduce it in debug mode. We will try to reproduce this and get back to you with logs. Thanks!

Yes. Would very much appreciate a little more information. In the maintime, I filed CBL-3529 to track this.

… and, as I said, those are two very different stack traces. You are seeing a lot of errors with which one of them?

Hi @blake.meike,

I see this CBL-3529 is marked as fixed in the Jira. Can I know in which this has been fixed? Can we test version?

We see lot of following errors in production when users are at the edge of network which keeps them switching online and offline quite often.

Another question out of curiosity, does continuous replication forces cblite to listen for network change? or cblite listens to network change irrespective of replication sync mode?

android.net.ConnectivityManager$TooManyRequestsException: null
    at android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java:3970)
    at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4159)
    at android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4688)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4655)
    at android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4629)
    at com.couchbase.lite.internal.AndroidConnectivityManager$ConnectivityListenerPost28.start(AndroidConnectivityManager.java:245)
    at com.couchbase.lite.internal.AndroidConnectivityManager.start(AndroidConnectivityManager.java:345)
    at com.couchbase.lite.internal.AndroidConnectivityManager.registerObserver(AndroidConnectivityManager.java:299)
    at com.couchbase.lite.internal.replicator.AndroidConnectivityObserver.handleOffline(AndroidConnectivityObserver.java:57)
    at com.couchbase.lite.Replicator.handleOffline(Replicator.java:86)
    at com.couchbase.lite.AbstractReplicator.c4StatusChanged(AbstractReplicator.java:743)
    at com.couchbase.lite.AbstractReplicator$ReplicatorListener.lambda$statusChanged$0(AbstractReplicator.java:255)
    at com.couchbase.lite.-$$Lambda$AbstractReplicator$ReplicatorListener$K9fvruo4ys5Od7V8e4M_8F5AQzk.run
    at com.couchbase.lite.internal.AbstractExecutionService$InstrumentedTask.run(AbstractExecutionService.java:94)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)

The bug (it is a bug) is fixed in 3.1. I am not involved in setting product release schedules so anything I say about them should, absolutely, be taken with a grain of salt. That said, I do not think there are plans to release another 3.0 version (with a backport of the fix) and I would expect that 3.1 will be released sometime in early 2023.

I have committed the fix and it should be available at the head of the Community Edition source, if that is helpful, in any way.

This is the fix: couchbase-lite-java-common/AndroidConnectivityManager.java at 58cdb636c23ba46a670a266f0a57ae573cbdd892 · couchbase/couchbase-lite-java-common · GitHub

Thank you @blake.meike

Hi @blake.meike

Can you please point me to the steps to build the Couchbase lite android sdk from the github source code?

Note: I found build steps for couchbase-lite-core and it is generating the .so file as expected.

Thanks

Yeah, @Ajay_Koppisetty… Sorry about that. The build instructions are way, way out of date. I’m scheduled to fix that, in fact, this very day. Stay tuned.

@Ajay_Koppisetty Done. Please let me know if you encounter any problems.

Hi @blake.meike,

Thank you very much for updating the steps in time. Really appreciate it!

When I tried to build the core, it is throwing the following errors. Please find below below.

Note: I want to test the fix that you have made on 2.8.x version, so trying to build the release/hydrogen branch.

koppisetty@Ajay couchbase-lite-core % export SDK_HOME="/Users/koppisetty/Library/Android/sdk"
koppisetty@Ajay couchbase-lite-core % export NDK_VER="25.1.8937393"                          
koppisetty@Ajay couchbase-lite-core % export CMAKE_VER="3.22.1"                              
koppisetty@Ajay couchbase-lite-core % export CMAKE_PATH="${SDK_HOME}/cmake/${CMAKE_VER}/bin" 
koppisetty@Ajay couchbase-lite-core % mkdir -p build_cmake/android/lib/armeabi-v7a           
koppisetty@Ajay couchbase-lite-core % cd build_cmake/android/lib/armeabi-v7a
koppisetty@Ajay armeabi-v7a % git status
On branch release/hydrogen
Your branch is up to date with 'origin/release/hydrogen'.

Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git restore <file>..." to discard changes in working directory)
 (commit or discard the untracked or modified content in submodules)
   modified:   ../../../../vendor/zlib (modified content, untracked content)

no changes added to commit (use "git add" and/or "git commit -a")                 
koppisetty@Ajay armeabi-v7a % ${CMAKE_PATH}/cmake \                                  
   -G Ninja \
   -DCMAKE_TOOLCHAIN_FILE="${SDK_HOME}/ndk/${NDK_VER}/build/cmake/android.toolchain.cmake" \
   -DCMAKE_MAKE_PROGRAM="${CMAKE_PATH}/ninja" \
   -DANDROID_NATIVE_API_LEVEL=19 \
   -DANDROID_ABI=armeabi-v7a \
   -DBUILD_ENTERPRISE=ON \
   -DCMAKE_BUILD_TYPE=MinSizeRel \
   ../../../..
CMake Deprecation Warning at vendor/zlib/CMakeLists.txt:1 (cmake_minimum_required):
 Compatibility with CMake < 2.8.12 will be removed from a future version of
 CMake.

 Update the VERSION argument <min> value or use a ...<max> suffix to tell
 CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at vendor/mbedtls/programs/ssl/CMakeLists.txt:2 (cmake_policy):
 The OLD behavior for policy CMP0076 will be removed from a future version
 of CMake.

 The cmake-policies(7) manual explains that the OLD behaviors of all
 policies are deprecated and that a policy should be set to OLD only under
 specific short-term circumstances.  Projects should be ported to the NEW
 behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at vendor/mbedtls/programs/test/CMakeLists.txt:2 (cmake_policy):
 The OLD behavior for policy CMP0076 will be removed from a future version
 of CMake.

 The cmake-policies(7) manual explains that the OLD behaviors of all
 policies are deprecated and that a policy should be set to OLD only under
 specific short-term circumstances.  Projects should be ported to the NEW
 behavior and not rely on setting a policy to OLD.


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a
koppisetty@Ajay armeabi-v7a % ${CMAKE_PATH}/cmake --build . --target LiteCore
[58/350] Building C object CMakeFiles/CouchbaseSqlite3.dir/LiteCore/Storage/SQLiteChooser.c.o
FAILED: CMakeFiles/CouchbaseSqlite3.dir/LiteCore/Storage/SQLiteChooser.c.o 
/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=armv7-none-linux-androideabi19 --sysroot=/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DCMAKE -DCOUCHBASE_ENTERPRISE -DHAVE_LOCALTIME_R -DHAVE_USLEEP -DHAVE_UTIME -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DISABLE_FTS3_UNICODE -DSQLITE_DQS=0 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT4 -DSQLITE_HAS_CODEC -DSQLITE_HAVE_ISNAN -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_SHARED_CACHE -D_FILE_OFFSET_BITS=32 -D__STDC_FORMAT_MACROS -I/Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/generated_headers -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/SQLiteCpp/sqlite3 -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -O3 -DNDEBUG -g -fPIC -DSQLITE_UNLINK_AFTER_CLOSE -std=gnu11 -MD -MT CMakeFiles/CouchbaseSqlite3.dir/LiteCore/Storage/SQLiteChooser.c.o -MF CMakeFiles/CouchbaseSqlite3.dir/LiteCore/Storage/SQLiteChooser.c.o.d -o CMakeFiles/CouchbaseSqlite3.dir/LiteCore/Storage/SQLiteChooser.c.o -c /Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Storage/SQLiteChooser.c
/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Storage/SQLiteChooser.c:35:18: fatal error: '../../../couchbase-lite-core-EE/Encryption/sqlite3-see-aes256-ofb.c' file not found
       #include "../../../couchbase-lite-core-EE/Encryption/sqlite3-see-aes256-ofb.c"
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[64/350] Building CXX object CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPTypes.cc.o
FAILED: CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPTypes.cc.o 
/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi19 --sysroot=/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DCMAKE -DCOUCHBASE_ENTERPRISE -D_FILE_OFFSET_BITS=32 -D__STDC_FORMAT_MACROS -I/Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/generated_headers -I/Users/koppisetty/Documents/couchbase-lite-core/C -I/Users/koppisetty/Documents/couchbase-lite-core/C/include -I/Users/koppisetty/Documents/couchbase-lite-core/Crypto -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Support -I/Users/koppisetty/Documents/couchbase-lite-core/Networking -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/BLIP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/WebSockets -I/Users/koppisetty/Documents/couchbase-lite-core/Replicator -I/Users/koppisetty/Documents/couchbase-lite-core/REST -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/Fleece/Support -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/API -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/sockpp/include -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/mbedtls/include -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Android -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security    -O3 -DNDEBUG -g -fPIC -std=gnu++17 -MD -MT CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPTypes.cc.o -MF CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPTypes.cc.o.d -o CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPTypes.cc.o -c /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:184:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(uint32_t, C4ErrorDomain) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:199:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int32_t, C4ErrorCode) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:238:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int32_t, C4NetworkErrorCode) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:304:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int8_t, C4LogLevel) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:34:13: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
   typedef C4_ENUM(int32_t, C4ReplicatorMode) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:42:13: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
   typedef C4_ENUM(int32_t, C4ReplicatorActivityLevel) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
6 errors generated.
[66/350] Building CXX object CMakeFiles/LiteCoreWebSocket.dir/Networking/NetworkInterfaces.cc.o
FAILED: CMakeFiles/LiteCoreWebSocket.dir/Networking/NetworkInterfaces.cc.o 
/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi19 --sysroot=/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DCMAKE -DCOUCHBASE_ENTERPRISE -D_FILE_OFFSET_BITS=32 -D__STDC_FORMAT_MACROS -I/Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/generated_headers -I/Users/koppisetty/Documents/couchbase-lite-core/C -I/Users/koppisetty/Documents/couchbase-lite-core/C/include -I/Users/koppisetty/Documents/couchbase-lite-core/Crypto -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Support -I/Users/koppisetty/Documents/couchbase-lite-core/Networking -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/BLIP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/WebSockets -I/Users/koppisetty/Documents/couchbase-lite-core/Replicator -I/Users/koppisetty/Documents/couchbase-lite-core/REST -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/Fleece/Support -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/API -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/sockpp/include -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/mbedtls/include -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Android -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security    -O3 -DNDEBUG -g -fPIC -std=gnu++17 -MD -MT CMakeFiles/LiteCoreWebSocket.dir/Networking/NetworkInterfaces.cc.o -MF CMakeFiles/LiteCoreWebSocket.dir/Networking/NetworkInterfaces.cc.o.d -o CMakeFiles/LiteCoreWebSocket.dir/Networking/NetworkInterfaces.cc.o -c /Users/koppisetty/Documents/couchbase-lite-core/Networking/NetworkInterfaces.cc
/Users/koppisetty/Documents/couchbase-lite-core/Networking/NetworkInterfaces.cc:328:13: error: 'getifaddrs' is unavailable: introduced in Android 24
       if (getifaddrs(&addrs) < 0)
           ^
/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Android/getifaddrs.h:55:5: note: 'getifaddrs' has been explicitly marked unavailable here
int getifaddrs(struct ifaddrs** __list_ptr) __INTRODUCED_IN(24);
   ^
/Users/koppisetty/Documents/couchbase-lite-core/Networking/NetworkInterfaces.cc:358:9: error: 'freeifaddrs' is unavailable: introduced in Android 24
       freeifaddrs(addrs);
       ^
/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Android/getifaddrs.h:54:6: note: 'freeifaddrs' has been explicitly marked unavailable here
void freeifaddrs(struct ifaddrs* __ptr) __INTRODUCED_IN(24);
    ^
2 errors generated.
[67/350] Building CXX object CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPLogic.cc.o
FAILED: CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPLogic.cc.o 
/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi19 --sysroot=/Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DCMAKE -DCOUCHBASE_ENTERPRISE -D_FILE_OFFSET_BITS=32 -D__STDC_FORMAT_MACROS -I/Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/generated_headers -I/Users/koppisetty/Documents/couchbase-lite-core/C -I/Users/koppisetty/Documents/couchbase-lite-core/C/include -I/Users/koppisetty/Documents/couchbase-lite-core/Crypto -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Support -I/Users/koppisetty/Documents/couchbase-lite-core/Networking -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/BLIP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP -I/Users/koppisetty/Documents/couchbase-lite-core/Networking/WebSockets -I/Users/koppisetty/Documents/couchbase-lite-core/Replicator -I/Users/koppisetty/Documents/couchbase-lite-core/REST -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/Fleece/Support -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/fleece/API -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/sockpp/include -I/Users/koppisetty/Documents/couchbase-lite-core/vendor/mbedtls/include -I/Users/koppisetty/Documents/couchbase-lite-core/LiteCore/Android -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security    -O3 -DNDEBUG -g -fPIC -std=gnu++17 -MD -MT CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPLogic.cc.o -MF CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPLogic.cc.o.d -o CMakeFiles/LiteCoreWebSocket.dir/Networking/HTTP/HTTPLogic.cc.o -c /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:184:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(uint32_t, C4ErrorDomain) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:199:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int32_t, C4ErrorCode) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:238:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int32_t, C4NetworkErrorCode) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:20:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Document.h:21:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Base.h:304:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef C4_ENUM(int8_t, C4LogLevel) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:34:13: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
   typedef C4_ENUM(int32_t, C4ReplicatorMode) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.cc:19:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPLogic.hh:8:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/HTTP/HTTPTypes.hh:11:
In file included from /Users/koppisetty/Documents/couchbase-lite-core/Networking/Address.hh:20:
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Replicator.h:42:13: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
   typedef C4_ENUM(int32_t, C4ReplicatorActivityLevel) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/koppisetty/Documents/couchbase-lite-core/C/include/c4Compat.h:47:54: note: expanded from macro 'C4_ENUM'
       #define C4_ENUM(_type, _name)     enum _name : _type _name; enum _name : _type
                                                    ^~~~~~~
6 errors generated.
ninja: build stopped: subcommand failed.
koppisetty@Ajay armeabi-v7a % 

Meanwhile I tried to build the master branch code and I was able to generate lite core binary files. But then it failed since couldn’t find cmake with 3.23.0 version.

[CXX1300] CMake '3.23.0' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.24.1' found in PATH did not satisfy requested version.
[CXX1301] - CMake '3.10.2' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.22.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.6.0' found in SDK did not satisfy requested version.

The latest android studio chipmunk supports cmake 3.22.1 as latest version

Full build log for master branch but failed at ./gradlew assemble step

koppisetty@Ajay couchbase-lite-core % export SDK_HOME="/Users/koppisetty/Library/Android/sdk"
koppisetty@Ajay couchbase-lite-core % export NDK_VER="25.1.8937393"
koppisetty@Ajay couchbase-lite-core % export CMAKE_VER="3.22.1"
koppisetty@Ajay couchbase-lite-core % export CMAKE_PATH="${SDK_HOME}/cmake/${CMAKE_VER}/bin"
koppisetty@Ajay couchbase-lite-core % mkdir -p build_cmake/android/lib/armeabi-v7a
koppisetty@Ajay couchbase-lite-core % cd build_cmake/android/lib/armeabi-v7a
koppisetty@Ajay armeabi-v7a % git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
	modified:   ../../../../vendor/zlib (modified content, untracked content)

no changes added to commit (use "git add" and/or "git commit -a")
koppisetty@Ajay armeabi-v7a % ${CMAKE_PATH}/cmake \
    -G Ninja \
    -DCMAKE_TOOLCHAIN_FILE="${SDK_HOME}/ndk/${NDK_VER}/build/cmake/android.toolchain.cmake" \
    -DCMAKE_MAKE_PROGRAM="ninja" \
    -DANDROID_NATIVE_API_LEVEL=22 \
    -DANDROID_ABI=armeabi-v7a \
    -DCMAKE_BUILD_TYPE=MinSizeRel \
    ../../../..
-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/koppisetty/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Looking for pthread_getname_np in pthread
-- Looking for pthread_getname_np in pthread - not found
-- Looking for pthread_threadid_np in pthread
-- Looking for pthread_threadid_np in pthread - not found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - found
-- Looking for prctl
-- Looking for prctl - found
-- Looking for sys/syscall.h
-- Looking for sys/syscall.h - found
-- Looking for SYS_gettid
-- Looking for SYS_gettid - found
-- Looking for linux/unistd.h
-- Looking for linux/unistd.h - found
-- Looking for __NR_gettid
-- Looking for __NR_gettid - found
-- Found Python3: /usr/local/Frameworks/Python.framework/Versions/3.10/bin/python3.10 (found version "3.10.6") found components: Interpreter 
get_repo_version.sh: Updated /Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/generated_headers/repo_version.h
CMake Deprecation Warning at vendor/zlib/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Check size of socklen_t
-- Check size of socklen_t - done
-- Configuring done
CMake Warning (dev) at vendor/mbedtls/library/CMakeLists.txt:191 (add_library):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "mbedcrypto" of type "STATIC_LIBRARY" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/mbedtls/library/CMakeLists.txt:195 (add_library):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "mbedx509" of type "STATIC_LIBRARY" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/mbedtls/library/CMakeLists.txt:199 (add_library):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "mbedtls" of type "STATIC_LIBRARY" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/zlib/CMakeLists.txt:187 (add_library):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "zlibstatic" of type "STATIC_LIBRARY" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/zlib/CMakeLists.txt:233 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "example" of type "EXECUTABLE" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/zlib/CMakeLists.txt:237 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "minigzip" of type "EXECUTABLE" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/zlib/CMakeLists.txt:241 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "example64" of type "EXECUTABLE" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at vendor/zlib/CMakeLists.txt:246 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "minigzip64" of type "EXECUTABLE" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/koppisetty/Documents/couchbase-lite-core/build_cmake/android/lib/armeabi-v7a
koppisetty@Ajay armeabi-v7a % ninja LiteCore
[329/329] Linking CXX shared library libLiteCore.so
koppisetty@Ajay armeabi-v7a % cd ../../../..
koppisetty@Ajay couchbase-lite-core % cd ..                     
koppisetty@Ajay Documents % git clone https://github.com/couchbase/couchbase-lite-java-ce-root --recurse-submodules
Cloning into 'couchbase-lite-java-ce-root'...
remote: Enumerating objects: 132, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 132 (delta 40), reused 90 (delta 40), pack-reused 41
Receiving objects: 100% (132/132), 144.42 KiB | 18.05 MiB/s, done.
Resolving deltas: 100% (51/51), done.
Submodule 'ce' (https://github.com/couchbase/couchbase-lite-java-ce) registered for path 'ce'
Submodule 'common' (https://github.com/couchbase/couchbase-lite-java-common) registered for path 'common'
Cloning into '/Users/koppisetty/Documents/couchbase-lite-java-ce-root/ce'...
remote: Enumerating objects: 36376, done.        
remote: Counting objects: 100% (1787/1787), done.        
remote: Compressing objects: 100% (558/558), done.        
remote: Total 36376 (delta 971), reused 1691 (delta 889), pack-reused 34589        
Receiving objects: 100% (36376/36376), 62.38 MiB | 16.95 MiB/s, done.
Resolving deltas: 100% (16132/16132), done.
Cloning into '/Users/koppisetty/Documents/couchbase-lite-java-ce-root/common'...
remote: Enumerating objects: 46732, done.        
remote: Counting objects: 100% (9402/9402), done.        
remote: Compressing objects: 100% (2206/2206), done.        
remote: Total 46732 (delta 5288), reused 9056 (delta 5070), pack-reused 37330        
Receiving objects: 100% (46732/46732), 64.66 MiB | 17.06 MiB/s, done.
Resolving deltas: 100% (21952/21952), done.
Submodule path 'ce': checked out '590b50a179438ff097053c86b28c163750a48c8e'
Submodule path 'common': checked out '9fe884878fb97892f6be612b829327abfdba17f9'
koppisetty@Ajay Documents % cd couchbase-lite-java-ce-root 
koppisetty@Ajay couchbase-lite-java-ce-root % etc/install_lite_core.sh 
Usage: etc/install_lite_core.sh <abi> <core root> <liteCore bin path>
koppisetty@Ajay couchbase-lite-java-ce-root % etc/install_lite_core.sh android/armeabi-v7a ../couchbase-lite-core ../couchbase-lite-core/build_cmake/android/lib/armeabi-v7a/libLiteCore.so 
koppisetty@Ajay couchbase-lite-java-ce-root % cd ce/android
koppisetty@Ajay android % ./gradlew assemble
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

> Configure project :lib
Checking the license for package NDK (Side by side) 25.0.8775105 in /Users/koppisetty/Library/Android/sdk/licenses
License for package NDK (Side by side) 25.0.8775105 accepted.
Preparing "Install NDK (Side by side) 25.0.8775105 (revision: 25.0.8775105)".
"Install NDK (Side by side) 25.0.8775105 (revision: 25.0.8775105)" ready.
Installing NDK (Side by side) 25.0.8775105 in /Users/koppisetty/Library/Android/sdk/ndk/25.0.8775105
"Install NDK (Side by side) 25.0.8775105 (revision: 25.0.8775105)" complete.
"Install NDK (Side by side) 25.0.8775105 (revision: 25.0.8775105)" finished.
C/C++: Could not execute cmake at '/Users/koppisetty/Library/Android/sdk' to get version. Skipping.
[CXX1300] CMake '3.23.0' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.24.1' found in PATH did not satisfy requested version.
[CXX1301] - CMake '3.10.2' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.22.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.6.0' found in SDK did not satisfy requested version.
C/C++: Could not execute cmake at '/Users/koppisetty/Library/Android/sdk' to get version. Skipping.
[CXX1300] CMake '3.23.0' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.24.1' found in PATH did not satisfy requested version.
[CXX1301] - CMake '3.10.2' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.22.1' found in SDK did not satisfy requested version.
[CXX1301] - CMake '3.6.0' found in SDK did not satisfy requested version.
WARNING:C/C++: Could not execute cmake at '/Users/koppisetty/Library/Android/sdk' to get version. Skipping.
C/C++: Could not execute cmake at '/Users/koppisetty/Library/Android/sdk' to get version. Skipping.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':lib'.
> Failed to notify project evaluation listener.
   > [CXX1300] CMake '3.23.0' was not found in SDK, PATH, or by cmake.dir property.
   > Could not get unknown property 'compileReleaseKotlin' for task ':lib:javadoc' of type org.gradle.api.tasks.javadoc.Javadoc.
   > Could not get unknown property 'compileDebugKotlin' for task ':lib:spotbugsHtml' of type com.github.spotbugs.snom.SpotBugsTask.
   > Could not get unknown property 'compileDebugKotlin' for task ':lib:spotbugsXml' of type com.github.spotbugs.snom.SpotBugsTask.

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 15s
koppisetty@Ajay android % 

I can try to get someone from the LiteCore team to respond, here. I don’t build LiteCore and don’t know much about how to do it. It looks to me, though, as if you are just using the wrong tool-chain.

Actually… none of the changes I made have anything to do with the hydrogen branch. That is a pretty old version and I’m not sure I will be able to find resources to work on it. I am not, at all, surprised that you cannot build it with a recent CMake. Chipmunk appeared nearly two years after 2.8.x was released. While we do a lot of great stuff, here at Couchbase, reading crystal balls is not a normal part on engineering :stuck_out_tongue_winking_eye:

Later:
I’ve updated the the hydrogen branch and built it, successfully, from a clean clone, for all 4 ABIs. Please be sure to do the following:

  • Install the necessary Android sdk components. You will not be able to build this with recent tools
  • Check out the release/hydrogen branch of the root repository. origin/master is the 3.1 release.
  • git submodule update --init --recursive : be sure you have the right versions of all the submodules
  • get the right local.properties. Mine contains a single entry, pointing to my SDK installation.
    sdk.dir=/Users/blakemeike/Library/Android/sdk

You should get a couple warnings and an (ignored) error during the javadoc build and a runable library

1 Like

@blake.meike I was finally able to generate the SDK after adjusting tool chain versions. Thank you for directing my attention in the right direction.

@Ajay_Koppisetty
FWIW, the PR for the fix is here:

Only the change at line 313 is necessary. The rest is just bullet-proofing.