# Unable to build CNSDK sample app with multiple ABIs

**URL:** https://forums.leialoft.com/t/unable-to-build-cnsdk-sample-app-with-multiple-abis/3970
**Category:** Core SDK Android
**Created:** [December 10, 2023, 11:17pm UTC](https://forums.leialoft.com/t/unable-to-build-cnsdk-sample-app-with-multiple-abis/3970 "2023-12-10T23:17:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lostart](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lostart](https://forums.leialoft.com/u/lostart)
#### Post date: [December 10, 2023, 11:17pm UTC](https://forums.leialoft.com/t/unable-to-build-cnsdk-sample-app-with-multiple-abis/3970/1 "2023-12-10T23:17:46Z")

</div>

For integration in a real-world app that ships with the both `arm64-v8a` and `armeabi-v7a` libs, it would also be necessary for the CNSDK to seamlessly build and run on either 64bit or 32bit hardware. Unfortunately, attempting to include `armeabi-v7a` support in the CNSDK sample app fails.

**Steps to reproduce**

- In CNSDK sample app [`build.gradle`](https://github.com/LeiaInc/CNSDKGettingStartedGLAndroidNative/blob/main/app/build.gradle) change line 14  
from  
` ndk.abiFilters 'arm64-v8a'`  
to  
` ndk.abiFilters 'arm64-v8a', "armeabi-v7a"`
- Run menu item `Build > Build Bundle(s) / APK(s) > Build APK(s)`

Will observe build failure with error:

```auto
C/C++: debug|armeabi-v7a :CMake Error at CMakeLists.txt:7 (find_package):
C/C++: debug|armeabi-v7a : Could not find a configuration file for package "CNSDK" that is compatible
C/C++: debug|armeabi-v7a : with requested version "".
C/C++: debug|armeabi-v7a : The following configuration files were considered but not accepted:
C/C++: debug|armeabi-v7a : <...>/CNSDKGettingStartedGLAndroidNative/build/cnsdk-android-0.7.28/share/cmake/CNSDK/CNSDKConfig.cmake, version: 0.7.28 (64bit)

```

Note the ` (64bit)` at the end of the last error line, possibly need to explicitly set up for 32 bit ABI build

P.S. Obviously 64 bit is the future and no upcoming Leia products will be 32 bit, so why is this important? Because developers considering adopting CNSDK for _optional_ support of Leia hardware in their own apps, which probably build for all 4 supported ABIs (`arm64-v8a`, `armeabi-v7a`, `x86_64`, `x86`), would not want their apps in the field to face any breakage due to missing ABIs in Leia’s CNSDK. In fact, not only should CNSDK ship with working `armeabi-v7a` support, it should ideally also bundle `x86_64` and `x86` libs as well. Again, this is not about Leia hardware, it’s about seamless integration with 3rd party apps which may well target older devices, chromebooks on Intel chips, etc., and which would benefit from also supporting stereo 3D when running on Leia hardware (my guess is this would be as simple as adding the ABIs in `ndk.abiFilters` of the CNSDK build gradle files, with no source code modifications required)

---

<div class="post-metadata">

### Author: ![lostart](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lostart](https://forums.leialoft.com/u/lostart)
#### Post date: [December 25, 2023, 2:34am UTC](https://forums.leialoft.com/t/unable-to-build-cnsdk-sample-app-with-multiple-abis/3970/2 "2023-12-25T02:34:16Z")

</div>

Looking at file

```auto
build/cnsdk-android-0.7.28/share/cmake/CNSDK/CNSDKTargets-release.cmake

```

the only ABI mentioned is `arm64-v8a` i.e.

```auto
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/arm64-v8a/libleiaSDK-faceTrackingInService.so"

```

So fix could be as simple as checking the cmake scripts in `build/cnsdk-android-0.7.28/share/cmake` to make sure other ABIs point to their respective `.so` libs

---

<div class="post-metadata">

### Author: ![lostart](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lostart](https://forums.leialoft.com/u/lostart)
#### Post date: [December 25, 2023, 2:40am UTC](https://forums.leialoft.com/t/unable-to-build-cnsdk-sample-app-with-multiple-abis/3970/3 "2023-12-25T02:40:17Z")

</div>

In file

```auto
build/cnsdk-android-0.7.28/share/cmake/CNSDK/CNSDKTargets-release.cmake

```

tried replacing `arm64-v8a` with `${CMAKE_ANDROID_ARCH_ABI}` i.e.

```auto
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_ANDROID_ARCH_ABI}/libleiaSDK-faceTrackingInService.so"
...
list(APPEND _cmake_import_check_files_for_CNSDK::leiaSDK-faceTrackingInService-shared "${_IMPORT_PREFIX}/lib/${CMAKE_ANDROID_ARCH_ABI}/libleiaSDK-faceTrackingInService.so" )

```

but that didn’t seem to help, fails with same error when building on 32 bit ARM device
