Repository: conan-io/conan-center-index

Issue:
[package] <android-ndk>/<r21e>: the clang compiler does not support '-march=armv7-a'
### Package and Environment Details

* Package Name/Version: **android-ndk/r21e**
* Operating System+version: **macOS 12.x**
* Compiler+version: **Apple Clang**
* Conan version: **conan 1.51.3**
* Python version: **Python 3.9.0**


### Conan profile

conanfile.py:

```
from conans import ConanFile, tools

class ModuleConan(ConanFile):
    name = "conan-sample"
    description = "An example for Android lib build by Conan package"
    settings = "os", "compiler", "build_type", "arch"
    generators = "cmake"

    def requirements(self):
        self.requires("c-ares/1.18.1")
```

build profile:

```
Configuration for profile default:

[settings]
os=Macos
os_build=Macos
os.version=10.14
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=13.1
compiler.libcxx=libc++
compiler.cppstd=14
build_type=Release
[options]
[conf]
[build_requires]
[env]
CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden
CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden
```

host profile named `android-arm64-v8a-abi21` under project `.profiles` folder

```
[settings]
arch=armv8
compiler=clang
compiler.libcxx=libc++
compiler.cppstd=14
compiler.version=9
os=Android
os.api_level=21

[tool_requires]
android-ndk/r21e

[options]
[conf]
[env]
```

### Steps to reproduce

My CMakeLists.txt:

```
cmake_minimum_required(VERSION 3.18)

project(sample)

# conan
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
    if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
        MESSAGE(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
        FILE(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake")
    endif ()
    include(${CMAKE_BINARY_DIR}/conan.cmake)
    if (CONAN_PROFILE_BUILD AND CONAN_PROFILE_HOST)
        conan_cmake_install(PATH_OR_REFERENCE .. BUILD missing UPDATE
            SETTINGS_HOST build_type=${CMAKE_BUILD_TYPE}
            SETTINGS_BUILD build_type=${CMAKE_BUILD_TYPE}
            PROFILE_BUILD ${CONAN_PROFILE_BUILD}
            PROFILE_HOST ${CONAN_PROFILE_HOST})
    else ()
        conan_cmake_autodetect(settings)
        conan_cmake_install(PATH_OR_REFERENCE .. BUILD missing UPDATE SETTINGS ${settings})
    endif ()
endif ()
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_library(${PROJECT_NAME} STATIC entry.cc)
```

Execute this cmd:

```
cmake -Barm64-v8a -DCMAKE_BUILD_TYPE=Release \
    -DCONAN_PROFILE_BUILD=default
    -DCONAN_PROFILE_HOST=$(pwd)/.profiles/android-arm64-v8a-abi21 \
    -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=21 \
    -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
    -DCMAKE_ANDROID_NDK=/Users/admin/Library/Android/sdk/ndk/21.4.7075529
```

### Logs

<details><summary>Click to expand log</summary>

```
-- Conan: Adding NetEaseConan remote repository (http://yunxin-conan.netease.im:8082/artifactory/api/conan/NetEaseConan) verify ssl (True)
-- Conan: checking conan executable
-- Conan: Found program /usr/local/bin/conan
-- Conan: Version found Conan version 1.51.3
-- Conan executing: /usr/local/bin/conan install .. --update --build missing --profile:host /Users/admin/Documents/temporary/conan-sample/.profiles/android-arm64-v8a-abi21 --profile:build default --settings:host build_type=Release --settings:build build_type=Release
Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.cppstd=14
compiler.libcxx=libc++
compiler.version=9
os=Android
os.api_level=21
[options]
[build_requires]
*: android-ndk/r21e
[env]

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=14
compiler.libcxx=libc++
compiler.version=13.1
os=Macos
os.version=10.14
os_build=Macos
[options]
[build_requires]
[env]
CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden
CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden
c-ares/1.18.1: WARN: Package binary is corrupted, removing: 08d63d4a44b326a004878a2a4fe535ee12d3a237
android-ndk/r21e: WARN: Can't update, no package in remote
conanfile.py (conan-sample/None): Installing package
Requirements
    c-ares/1.18.1 from 'conancenter' - Cache
Packages
    c-ares/1.18.1:08d63d4a44b326a004878a2a4fe535ee12d3a237 - Build
Build requirements
    android-ndk/r21e from 'conancenter' - Cache
Build requirements packages
    android-ndk/r21e:69d0be4c0d76c27b2932dc6f3d523bf04a772ba9 - Cache

Cross-build from 'Macos:x86_64' to 'Android:armv8'
Installing (downloading, building) binaries...
android-ndk/r21e: Already installed!
android-ndk/r21e: Creating CONAN_CMAKE_PROGRAM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/cmake-wrapper
android-ndk/r21e: Creating CC environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
android-ndk/r21e: Creating CXX environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++
android-ndk/r21e: Creating AR environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
android-ndk/r21e: Creating AS environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-as
android-ndk/r21e: Creating RANLIB environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ranlib
android-ndk/r21e: Creating STRIP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
android-ndk/r21e: Creating ADDR2LINE environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-addr2line
android-ndk/r21e: Creating NM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-nm
android-ndk/r21e: Creating OBJCOPY environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
android-ndk/r21e: Creating OBJDUMP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objdump
android-ndk/r21e: Creating READELF environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf
android-ndk/r21e: Creating ELFEDIT environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-elfedit
android-ndk/r21e: Creating LD environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ld
android-ndk/r21e: Creating CC environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
android-ndk/r21e: Creating CXX environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++
android-ndk/r21e: Creating AR environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
android-ndk/r21e: Creating AS environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-as
android-ndk/r21e: Creating RANLIB environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ranlib
android-ndk/r21e: Creating STRIP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
android-ndk/r21e: Creating ADDR2LINE environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-addr2line
android-ndk/r21e: Creating NM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-nm
android-ndk/r21e: Creating OBJCOPY environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
android-ndk/r21e: Creating OBJDUMP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objdump
android-ndk/r21e: Creating READELF environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf
android-ndk/r21e: Creating ELFEDIT environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-elfedit
android-ndk/r21e: Creating LD environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ld
android-ndk/r21e: Creating CONAN_CMAKE_PROGRAM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/cmake-wrapper
android-ndk/r21e: Creating CC environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
android-ndk/r21e: Creating CXX environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++
android-ndk/r21e: Creating AR environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
android-ndk/r21e: Creating AS environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-as
android-ndk/r21e: Creating RANLIB environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ranlib
android-ndk/r21e: Creating STRIP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
android-ndk/r21e: Creating ADDR2LINE environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-addr2line
android-ndk/r21e: Creating NM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-nm
android-ndk/r21e: Creating OBJCOPY environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
android-ndk/r21e: Creating OBJDUMP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objdump
android-ndk/r21e: Creating READELF environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf
android-ndk/r21e: Creating ELFEDIT environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-elfedit
android-ndk/r21e: Creating LD environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ld
android-ndk/r21e: Creating CC environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
android-ndk/r21e: Creating CXX environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++
android-ndk/r21e: Creating AR environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
android-ndk/r21e: Creating AS environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-as
android-ndk/r21e: Creating RANLIB environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ranlib
android-ndk/r21e: Creating STRIP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-strip
android-ndk/r21e: Creating ADDR2LINE environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-addr2line
android-ndk/r21e: Creating NM environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-nm
android-ndk/r21e: Creating OBJCOPY environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy
android-ndk/r21e: Creating OBJDUMP environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objdump
android-ndk/r21e: Creating READELF environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-readelf
android-ndk/r21e: Creating ELFEDIT environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-elfedit
android-ndk/r21e: Creating LD environment variable: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ld
c-ares/1.18.1: Applying build-requirement: android-ndk/r21e
c-ares/1.18.1: WARN: Build folder is dirty, removing it: /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237
c-ares/1.18.1: Copying sources to build folder
c-ares/1.18.1: Building your package in /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237
c-ares/1.18.1: Generator txt created conanbuildinfo.txt
c-ares/1.18.1: Calling generate()
c-ares/1.18.1: Aggregating env generators
c-ares/1.18.1: Calling build()
c-ares/1.18.1: CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/admin/.conan/data/c-ares/1.18.1/_/_/package/08d63d4a44b326a004878a2a4fe535ee12d3a237" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/src"
-- Using Conan toolchain: /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/generators/conan_toolchain.cmake
-- ANDROID_PLATFORM not set. Defaulting to minimum supported version
16.
-- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
-- Check for working C compiler: /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - broken
CMake Error at /usr/local/Cellar/cmake/3.21.3_1/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/Release/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_dfe3e/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_dfe3e.dir/build.make CMakeFiles/cmTC_dfe3e.dir/build
    Building C object CMakeFiles/cmTC_dfe3e.dir/testCCompiler.c.o
    /Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android21 --gcc-toolchain=/Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/admin/.conan/data/android-ndk/r21e/_/_/package/69d0be4c0d76c27b2932dc6f3d523bf04a772ba9/toolchains/llvm/prebuilt/darwin-x86_64/sysroot   -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   -fPIE -MD -MT CMakeFiles/cmTC_dfe3e.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_dfe3e.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_dfe3e.dir/testCCompiler.c.o -c /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/Release/CMakeFiles/CMakeTmp/testCCompiler.c
    clang: error: the clang compiler does not support '-march=armv7-a'
    make[1]: *** [CMakeFiles/cmTC_dfe3e.dir/testCCompiler.c.o] Error 1
    make: *** [cmTC_dfe3e/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:11 (PROJECT)


-- Configuring incomplete, errors occurred!
See also "/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/Release/CMakeFiles/CMakeOutput.log".
See also "/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/Release/CMakeFiles/CMakeError.log".
c-ares/1.18.1: 
c-ares/1.18.1: ERROR: Package '08d63d4a44b326a004878a2a4fe535ee12d3a237' build failed
c-ares/1.18.1: WARN: Build folder /Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/Release
ERROR: c-ares/1.18.1: Error in build() method, line 70
        cmake.configure()
        ConanException: Error 1 while executing cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/Users/admin/.conan/data/c-ares/1.18.1/_/_/package/08d63d4a44b326a004878a2a4fe535ee12d3a237" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/admin/.conan/data/c-ares/1.18.1/_/_/build/08d63d4a44b326a004878a2a4fe535ee12d3a237/src"
CMake Error at arm64-v8a/conan.cmake:651 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  CMakeLists.txt:14 (conan_cmake_install)


-- Configuring incomplete, errors occurred!
See also "/Users/admin/Documents/temporary/conan-sample/arm64-v8a/CMakeFiles/CMakeOutput.log".
See also "/Users/admin/Documents/temporary/conan-sample/arm64-v8a/CMakeFiles/CMakeError.log".
```

</details>



Discussion:
I'm seeing this same behavior in `android-ndk/r25`, but not in `android-ndk/r24`. 

Also, there is another issue that I'm encountering which may be related, and it's also present in your logs:

> ANDROID_PLATFORM not set. Defaulting to minimum supported version

With r24, I can get past the configuration, but the zlib fails to build because ANDROID_PLATFORM is set to a value that's too low.

I'm encountering this with **zlib**, **expat**, and **libwebp**. Not exactly sure yet what the problem is, however I did notice that all 3 use the CMakeToolchain generator. Maybe a recent change to that is causing issues?

My info is here:

* Package Name/Version: **android-ndk/r24**
* Operating System+version: **Ubuntu 22.04.1**
* Compiler+version: **Clang**
* Conan version: **conan 1.52.0**
* Python version: **Python 3.10.4**
It seems like commit e569e61db07d88bb26d54eaedc68a3c6f1485773 is good, but the next one 89ba59bca58190ae1af85628188e014317292785 is what causes both issues.

The cause of the ANDROID_PLATFORM issue seems to be that the generated toolchain file has a duplicate entry. Here's a snippet from the generated `conan_toolchain.cmake` file:

    # Conan automatically generated toolchain file
    # DO NOT EDIT MANUALLY, it will be overwritten

    # Avoid including toolchain file several times (bad if appending to variables like
    #   CMAKE_CXX_FLAGS. See https://github.com/android/ndk/issues/323
    include_guard()

    message(STATUS "Using Conan toolchain: ${CMAKE_CURRENT_LIST_FILE}")

    if(${CMAKE_VERSION} VERSION_LESS "3.15")
     message(FATAL_ERROR "The 'CMakeToolchain' generator only works with CMake >= 3.15")
    endif()


    include("/home/aramallo/.conan/data/android-ndk/r25/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/build/cmake/android.toolchain.cmake")






    # New toolchain things
    set(ANDROID_PLATFORM android-21)
    set(ANDROID_ABI arm64-v8a)
    include(/home/aramallo/.conan/data/android-ndk/r25/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/build/cmake/android.toolchain.cmake)

    message(STATUS "Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC)")
    set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Notice how the android.toolchain.cmake file is being included twice. The first time its included, ANDROID_PLATFORM isn't set, which is why the error occurs. Interestingly, reverting the android-ndk recipe to the previous commit fixes this and the configuration problem described above.
I resolved the issue by downgrading conan to version 1.48.0, and I now lock all packages to a specific reverision:

```
self.requires("c-ares/1.18.1#f6cf892fe94ae51a1b4dba565ad82e5e")
self.requires("aws-c-common/0.7.5#d98410ae6f77b81086e390b86d87c609")
self.requires("sqlite3/3.38.1#da99b567036f22b3aabe4e110fb2669f")
self.requires("jsoncpp/1.9.5#536d080aa154e5853332339bf576747c")
self.requires("zlib/1.2.12#3b9e037ae1c615d045a06c67d88491ae")
self.requires("nlohmann_json/3.11.2#a41bc0deaf7f40e7b97e548359ccf14d")
```

Also set the global configuration of conan:

```
conan config set general.revisions_enabled=True
```

And the `--update` parameter is specified when conan install:

```
conan install .. --update --build missing --settings build_type=Debug --settings compiler=apple-clang --settings compiler.version=13.1 --settings compiler.libcxx=libc++ --settings compiler.cppstd=14
```

But I'm still wondering what the reason is because I still want to keep conan up to date.

Resolving patch:
diff --git a/recipes/android-ndk/all/conanfile.py b/recipes/android-ndk/all/conanfile.py
--- a/recipes/android-ndk/all/conanfile.py
+++ b/recipes/android-ndk/all/conanfile.py
@@ -286,7 +286,10 @@ def package_info(self):
         self.env_info.CONAN_CMAKE_PROGRAM = cmake_wrapper
 
         toolchain = os.path.join(self.package_folder, "build", "cmake", "android.toolchain.cmake")
-        self.conf_info.prepend("tools.cmake.cmaketoolchain:user_toolchain", toolchain)
+
+        #CMakeToolchain automatically adds the standard Android toolchain file that ships with the NDK
+        #when `tools.android:ndk_path` is provided, so there's no need to add it as a `user_toolchain`
+        self.conf_info.define("tools.android:ndk_path", self.package_folder)
 
         self.buildenv_info.define_path("CC", self._define_tool_var("CC", "clang"))
         self.buildenv_info.define_path("CXX", self._define_tool_var("CXX", "clang++"))
@@ -319,7 +322,6 @@ def package_info(self):
         libcxx_str = str(self.settings_target.compiler.libcxx)
         self.buildenv_info.define("ANDROID_STL", libcxx_str if libcxx_str.startswith("c++_") else "c++_shared")
 
-        self.conf_info.define("tools.android:ndk_path", self.package_folder)
 
         # TODO: conan v1 stuff to remove later
         self.env_info.PATH.append(self.package_folder)


Test patch: