# \#os:android

**URL:** https://discourse.cmake.org/tag/os-android/20.md

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

---

## [cmake does not find libraries when compiling for Android](https://discourse.cmake.org/t/cmake-does-not-find-libraries-when-compiling-for-android/5098)

<div class="topic-metadata">

**Author:** [@emmenlau](https://discourse.cmake.org/u/emmenlau)\
**Replies:** 5\
**Last updated:** [May 26, 2024, 10:44am UTC](https://discourse.cmake.org/t/cmake-does-not-find-libraries-when-compiling-for-android/5098 "2024-05-26T10:44:52Z")

</div>

I’ve just today discovered that its surprisingly simple to compile c++ projects with cmake for Android. I use Ubuntu Linux as a host, with the latest NDK. The build worked smoothly for a whole number of standard librarie…

---

## [Fix Android Studio C/C++ project compile issues referencing cmake](https://discourse.cmake.org/t/fix-android-studio-c-c-project-compile-issues-referencing-cmake/3400)

<div class="topic-metadata">

**Author:** [@Bluechip\_Servers](https://discourse.cmake.org/u/Bluechip_Servers)\
**Replies:** 3\
**Last updated:** [May 25, 2021, 5:19pm UTC](https://discourse.cmake.org/t/fix-android-studio-c-c-project-compile-issues-referencing-cmake/3400 "2021-05-25T17:19:42Z")

</div>

I have an Android Studio project which has C/C++ functions, when I try to build apk, I get this errors, I have searched online for possible fix but could not ix this particular problem. Error: C/C++ debug|x86 : CMake E…

---

## [install(EXPORT ...) and install(EXPORT\_ANDROID\_MK ...) cannot coexist. why?](https://discourse.cmake.org/t/install-export-and-install-export-android-mk-cannot-coexist-why/10024)

<div class="topic-metadata">

**Author:** [@Lukasz\_Tyrala](https://discourse.cmake.org/u/Lukasz_Tyrala)\
**Replies:** 2\
**Last updated:** [February 7, 2024, 8:53pm UTC](https://discourse.cmake.org/t/install-export-and-install-export-android-mk-cannot-coexist-why/10024 "2024-02-07T20:53:09Z")

</div>

Hi, I want to build my library for Android AOSP. I want to build it as a library and install it with android.mk this is my CMake script: cmake\_minimum\_required(VERSION 3.22.1) # test output set(CMAKE\_INSTALL\_PREFIX "$…

---

## [How to get cmake to monitor a specific file](https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903)

<div class="topic-metadata">

**Author:** [@aidexie](https://discourse.cmake.org/u/aidexie)\
**Replies:** 1\
**Last updated:** [September 13, 2023, 2:25am UTC](https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903 "2023-09-13T02:25:33Z")

</div>

I am using android studio to compile a large project with many modules. When I modify CMakeList.txt, xxx.cmake files, it triggers android studio to go and regenerate the cmake project. I want to add some file types to mo…

---

## [Android: CMake fails to find basic NDK headers when compiling with standalone toolchain - bug, or I'm missing something?](https://discourse.cmake.org/t/android-cmake-fails-to-find-basic-ndk-headers-when-compiling-with-standalone-toolchain-bug-or-im-missing-something/8421)

<div class="topic-metadata">

**Author:** [@MaxEd](https://discourse.cmake.org/u/MaxEd)\
**Replies:** 10\
**Last updated:** [July 7, 2023, 8:37pm UTC](https://discourse.cmake.org/t/android-cmake-fails-to-find-basic-ndk-headers-when-compiling-with-standalone-toolchain-bug-or-im-missing-something/8421 "2023-07-07T20:37:50Z")

</div>

I’m trying to compile a library for Android that depends on EGL. I have NDK installed in C:\\Microsoft\\AndroidNDK\\android-ndk-r23c and SDK installed in C:\\Microsoft\\AndroidSDK. However, find\_package(OpenGL) fails with: -…

---

## [What is AndroidTestUtilities?](https://discourse.cmake.org/t/what-is-androidtestutilities/8365)

<div class="topic-metadata">

**Author:** [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)\
**Replies:** 1\
**Last updated:** [June 25, 2023, 7:37pm UTC](https://discourse.cmake.org/t/what-is-androidtestutilities/8365 "2023-06-25T19:37:16Z")

</div>

I’m currently working on our Android CMake build and stumbled on the following CMake module: https://cmake.org/cmake/help/latest/module/AndroidTestUtilities.html What does this module do? Is there an example I can look…

---

## [Looking for complete examples of cross platform projects](https://discourse.cmake.org/t/looking-for-complete-examples-of-cross-platform-projects/4731)

<div class="topic-metadata">

**Author:** [@obushnell](https://discourse.cmake.org/u/obushnell)\
**Replies:** 18\
**Last updated:** [January 18, 2023, 8:17pm UTC](https://discourse.cmake.org/t/looking-for-complete-examples-of-cross-platform-projects/4731 "2023-01-18T20:17:12Z")

</div>

Me and my colleagues are using CMake 3.20 to build cross platform projects. We can make it build and deploy on Windows, with some manual effort. We can’t get it to build on the other platforms without breaking the Window…

---

## [Locating a Problem while creating a Shared Library](https://discourse.cmake.org/t/locating-a-problem-while-creating-a-shared-library/3479)

<div class="topic-metadata">

**Author:** [@roottjk](https://discourse.cmake.org/u/roottjk)\
**Replies:** 2\
**Last updated:** [August 19, 2022, 10:18pm UTC](https://discourse.cmake.org/t/locating-a-problem-while-creating-a-shared-library/3479 "2022-08-19T22:18:15Z")

</div>

Hi guys, im pretty new to CMake and also to Android. Im supposed to port a c/c++ Program to Android. Its pretty complex and so is the CMakeLists.txt. I managed to successfully build an Android Version of the project run…

---

## [Android NDK r23 with CMake 3.21 or later](https://discourse.cmake.org/t/android-ndk-r23-with-cmake-3-21-or-later/4577)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 5\
**Last updated:** [December 4, 2021, 10:33am UTC](https://discourse.cmake.org/t/android-ndk-r23-with-cmake-3-21-or-later/4577 "2021-12-04T10:33:22Z")

</div>

I’m working through building for Android, specifically with NDK r23. From that NDK release, we should be back to a fully supported arrangement again if we are using CMake 3.21 or later. I want to record here things I fin…

---

## [Changing Java Version inside CMake](https://discourse.cmake.org/t/changing-java-version-inside-cmake/3541)

<div class="topic-metadata">

**Author:** [@inevo](https://discourse.cmake.org/u/inevo)\
**Replies:** 3\
**Last updated:** [June 14, 2021, 11:24am UTC](https://discourse.cmake.org/t/changing-java-version-inside-cmake/3541 "2021-06-14T11:24:02Z")

</div>

Hi, I need to cross-compile a jar and a shared library so that they will be imported into an Android application and ran on a machine running Ubuntu. For this reason I would like to create a CMakeLists.txt file that will…

---

## [How to pass compiler and options to external project configure script?](https://discourse.cmake.org/t/how-to-pass-compiler-and-options-to-external-project-configure-script/2261)

<div class="topic-metadata">

**Author:** [@penguin359](https://discourse.cmake.org/u/penguin359)\
**Replies:** 1\
**Last updated:** [November 30, 2020, 2:14pm UTC](https://discourse.cmake.org/t/how-to-pass-compiler-and-options-to-external-project-configure-script/2261 "2020-11-30T14:14:47Z")

</div>

I am using CMake to compile some native code for Android which relies on a third-party library that uses the autoconf/automake build system. I having trouble trying to figure out how to pass in all the appropriate variab…

---

## [Including resources with add\_jar](https://discourse.cmake.org/t/including-resources-with-add-jar/1583)

<div class="topic-metadata">

**Author:** [@Jacob\_Varghese](https://discourse.cmake.org/u/Jacob_Varghese)\
**Replies:** 1\
**Last updated:** [July 18, 2020, 9:00am UTC](https://discourse.cmake.org/t/including-resources-with-add-jar/1583 "2020-07-18T09:00:41Z")

</div>

Hi I’m trying to include some resources (jni library files) inside my jar but I’m facing issues to get exactly what I want. I use add\_jar(target SOURCES ${javasources} OUTPUT\_DIR ${BUILD\_ROOT}/jar) to generate the Jar a…

---

## [\[solved\] light theme is too dark](https://discourse.cmake.org/t/solved-light-theme-is-too-dark/1409)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 5\
**Last updated:** [June 19, 2020, 12:25pm UTC](https://discourse.cmake.org/t/solved-light-theme-is-too-dark/1409 "2020-06-19T12:25:19Z")

</div>

I chose the light theme on the mobile app for this forum. I find it very uncomfortable to read. the light theme is very dark, only a tiny bit lighter then the dark theme.

---

## [Building cmake from source for Android](https://discourse.cmake.org/t/building-cmake-from-source-for-android/1341)

<div class="topic-metadata">

**Author:** [@Jacob\_Varghese](https://discourse.cmake.org/u/Jacob_Varghese)\
**Replies:** 2\
**Last updated:** [June 9, 2020, 5:23am UTC](https://discourse.cmake.org/t/building-cmake-from-source-for-android/1341 "2020-06-09T05:23:50Z")

</div>

Has anyone tried building cmake for Android? Any issues? I would like to run ctest from within an emulator.
