Help: Error Trying to Compile the c++ library in Android using CMake. #3892
Unanswered
perojas3
asked this question in
Build and configuration issues
Replies: 1 comment 2 replies
-
One binary (protoc) under host_tools, which is required for cross-compilation, is missing. I am not sure if the binary is intentionally left out (proprietary?). Can maintainers comment whether Android cross-compilation is still not supported? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I'm trying to compile or-tools in Android, but there is always an error in the building process, and don't know what to do to continue.
This is the error:
I'm building from source using CMake, building all the dependencies
set(BUILD_DEPS ON)
to make sure to have the necessary ones to function. Followed the instructions here: https://github.com/google/or-tools/blob/stable/cmake/README.mdThe error does not seem to come from the dependencies, though. But from
host_tools
, I assume either of these files:But I don't know how to continue debugging from here.
The project is multi-platform, I have tried compiling it in Linux (Manjaro) and worked. The issue only occurs in Android. Right now, I am compiling using the C++17 Android Studio Pipeline. I'm developing using a Linux machine. And testing the code using the Android emulator, tried various images offered by Android Studio (api 27 x86, api 30 x86 and api 34 x86_64), and the problem is the same in all the cases. I'm unable to test in a real device right now.
Also, added compile setting
set(__PORTABLE_PLATFORM__)
because I found that it was recommended for compiling OR Tools in Android. Tested with and without that flag, and the result is the same.I'm using the version 9.7 of or-tools, calling it from CMake like this:
Also tried to manually download the repo
git clone
and add the subdirectory in CMakeadd_subdirectory(or-tools)
. Both cases gave the same error.I prepared a repository with the minimum code necessary to replicate the error. It is basically the default template for an Android Project with of C++, only that I added the lines of code to link the or-tools library. Here: https://github.com/perojas3/Example-on-Trying-to-compile-OR-Tools-in-Android
I know that you do not officially support Android, I'm just asking for pointers on how to solve this problem.
I have read in some issues that the development team build for Android internally. (These: #537 and #1130)
So assume there is a chance you can help me with this.
I hope you can.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions