I am trying to compile Bitcoin (Core) for Android using Android NDK in Android Studio, but I get a CMake Error: CMake can not determine linker language for target: bitcoin
. I cloned the Bitcoin repository into app/src/main/cpp/bitcoin
. My CMakeLists.txt
(in app/src/main/cpp/CMakeLists.txt
) is as follows:
cmake_minimum_required(VERSION 3.4.1)
project(bitcoin)
add_library(bitcoin SHARED bitcoin/src/)
I tried many solutions from this forum, including appending C CXX
and CXX
to the project name, adding an include_directories(bitcoin/src/)
, adding a set_target_properties(bitcoin PROPERTIES LINKER_LANGUAGE CXX)
, and various combinations of these, but the error persists. What am I doing wrong?