# Assistance Needed: Issue with C API Samples and SDK Compatibility in Magic Leap 2

**URL:** <https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897>\
**Category:** Native Development\
**Tags:** development\
**Created:** [May 11, 2023, 5:35pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897 "2023-05-11T17:35:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman.bashir](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@usman.bashir](https://forum.magicleap.cloud/u/usman.bashir)\
**Post date:** [May 11, 2023, 5:35pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/1 "2023-05-11T17:35:03Z")

</div>

Dear Community,

I hope this message finds you all well.

I am currently working on native development for Android using the C API Samples downloaded via the Magic Leap Hub. My goal is to delve deeper into the capabilities of the Magic Leap 2 platform.

However, I've encountered an issue regarding the compatibility of the samples with the Magic Leap SDK version (v1.2.0) that I'm using.

Here are the details of my setup:

**ML2 OS version** : v1.2.0

**MLSDK version** : v1.2.0

**Host OS** : Windows

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/ad94b12109cded5894e9f0909d2794e2c0145e1a.png)

Upon loading all the samples in the latest version of Android Studio, it appears that the samples may be outdated relative to the SDK version. Error messages from logs are as follows:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/ca1c273d1734484f5883f6bafdd81fd8983f356d.png)

I have also attached screenshots to provide a visual context of the issues I'm experiencing.

I would greatly appreciate any guidance or directions to updated examples compatible with the latest SDK. I have also tried all SDKs one by one but code has issues as functions, params are unknown or not defined.

Thank you for your time and assistance.

Best Regards,

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [May 11, 2023, 5:37pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/2 "2023-05-11T17:37:15Z")

</div>

@usman.bashir Did you include logs in the message?

---

<div class="post-metadata">

**Author:** ![usman.bashir](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@usman.bashir](https://forum.magicleap.cloud/u/usman.bashir)\
**Post date:** [May 11, 2023, 8:21pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/5 "2023-05-11T20:21:15Z")

</div>

Here are the logs;

```auto
[CXX1405] error when building with cmake using C:\Users\Ottoman\MagicLeap\mlsdk\v1.2.0\samples\c_api\samples\simple_gl_app\app\src\main\cpp\CMakeLists.txt: Build command failed.
Error while executing process C:\Program Files\CMake\bin\cmake.exe with arguments {-HC:\Users\Ottoman\MagicLeap\mlsdk\v1.2.0\samples\c_api\samples\simple_gl_app\app\src\main\cpp -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=29 -DANDROID_PLATFORM=android-29 -DANDROID_ABI=x86_64 -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DANDROID_NDK=C:\Users\Ottoman\AppData\Local\Android\Sdk\ndk\25.0.8775105 -DCMAKE_ANDROID_NDK=C:\Users\Ottoman\AppData\Local\Android\Sdk\ndk\25.0.8775105 -DCMAKE_TOOLCHAIN_FILE=C:\Users\Ottoman\AppData\Local\Android\Sdk\ndk\25.0.8775105\build\cmake\android.toolchain.cmake -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ottoman\MagicLeap\mlsdk\v1.2.0\samples\c_api\samples\simple_gl_app\app\build\intermediates\cxx\Debug\512w576i\obj\x86_64 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\Users\Ottoman\MagicLeap\mlsdk\v1.2.0\samples\c_api\samples\simple_gl_app\app\build\intermediates\cxx\Debug\512w576i\obj\x86_64 -DCMAKE_BUILD_TYPE=Debug -BC:\Users\Ottoman\MagicLeap\mlsdk\v1.2.0\samples\c_api\samples\simple_gl_app\app\.cxx\Debug\512w576i\x86_64 -GNinja -DANDROID_STL=c++_static}
-- Configuring incomplete, errors occurred!
See also "C:/Users/Ottoman/MagicLeap/mlsdk/v1.2.0/samples/c_api/samples/simple_gl_app/app/.cxx/Debug/512w576i/x86_64/CMakeFiles/CMakeOutput.log".

CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

```

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/c1956af013d671e3d7ca395823ac8720933b57ba.png)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/ba216f9c67d88183e4b5ff9c11c9090d2b3cf969.png)

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [May 12, 2023, 2:50am UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/6 "2023-05-12T02:50:06Z")

</div>

@usman.bashir Based on some of those logs, can you verify the following?

- [Native Setup Overview | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/native/getting-started/native-setup-overview)
- Ensure you have the Android SDK tools installed?

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [May 12, 2023, 2:52am UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/9 "2023-05-12T02:52:00Z")

</div>

Specifically, [Command Line Workflow | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/native/getting-started/command-line-workflow) and [Android Studio Workflow | MagicLeap Developer Documentation](https://developer-docs.magicleap.cloud/docs/guides/native/getting-started/android-studio-workflow) .

---

<div class="post-metadata">

**Author:** ![usman.bashir](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@usman.bashir](https://forum.magicleap.cloud/u/usman.bashir)\
**Post date:** [May 15, 2023, 12:51pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/10 "2023-05-15T12:51:19Z")

</div>

Thank you for your responses. I can confirm that all the necessary **Android SDK tools** have been successfully installed. I have thoroughly reviewed the **Native Setup Overview documentation** from Magic Leap 2 and ensured that the installation process was followed correctly.

I am attaching screenshots for your review;

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/cf566440cf3108217657918d17814ba90a5e0b2b.png)

**NDK:**

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/59c7eb4bd045a25b002ed5fe5739e3ce55e5ad4d.png)

**SDK Tools:**

 ![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/9e9cebbc72cd93a577e9625bdafb172b0f48d0af.png)

---

<div class="post-metadata">

**Author:** ![ejurinsky](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ejurinsky](https://forum.magicleap.cloud/u/ejurinsky)\
**Post date:** [May 23, 2023, 5:19am UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/11 "2023-05-23T05:19:56Z")

</div>

Usman, are you still having issues building native samples?

---

<div class="post-metadata">

**Author:** ![usman.bashir](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@usman.bashir](https://forum.magicleap.cloud/u/usman.bashir)\
**Post date:** [May 28, 2023, 1:52pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/12 "2023-05-28T13:52:14Z")

</div>

No, currently I am not actively engaged in any work. We have started working on unity production environment.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [May 30, 2023, 2:25pm UTC](https://forum.magicleap.cloud/t/assistance-needed-issue-with-c-api-samples-and-sdk-compatibility-in-magic-leap-2/1897/13 "2023-05-30T14:25:21Z")

</div>


