NDK error while building sample apk for CloudXR client

I have seen similar post regarding this but none of the answers helped me with my issiues.

I’m trying to set up a CloudXR client on an Oculus 2 with the 3.2 sdk. I’ve been following instructions in the documentation and can’t build the apk needed.

Error in Android Studio:

Build command failed.
Error while executing process C:\Users\AndroidSdk\Android\Sdk\ndk\21.4.7075529\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\src\main\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-24 NDK_OUT=C:/Users/AndroidSdk/CloudXR/Sample/Android/Ocu/OculusVR/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\build\intermediates\ndkBuild\debug\lib OVR_SDK_ROOT=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\build\ovr_sdk OBOE_SDK_ROOT=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\build\Oboe CLOUDXR_SDK_ROOT=C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\build\CloudXR C_SHARED_INCLUDE=C:\Users\AndroidSdk\CloudXR\Sample\Android\shared -j4 NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: C:/Users/AndroidSdk/Android/Sdk/ndk/21.4.7075529/build//…/sources/android/native_app_glue/Android.mk: Cannot find module with tag ‘VrApi/Projects/AndroidPrebuilt/jni’ in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:

C:\Users\AndroidSdk\CloudXR\Sample\Android\Ocu\OculusVR\app\src\main\jni\Android.mk:40: *** Android NDK: Aborting. . Stop.

Some of the things i have tried without any luck:

  • Removed any spaces in path
  • Set ndk path in eviroments on machine
  • Set NDK_MODULE_PATH as local variable on machine
  • Specify ndkDir = “${local.properties[‘path’]}” in build.gradle
  • in gradle.properties added android.useDeprecatedNdk=true
  • in local.properties set ndk.dir = path
  • I’ve deleted and reinstalled evrything
  • Tested to build in Android Studio 4.0
  • adding implementation ‘com.oculus.vrapi:vrapi:1.0.3’ in dependencies

Any help would be much appreciated!
Thank you / Frida

I’d double check these steps, as it sounds like maybe the oculus sdk isn’t there or named wrong or maybe too new an sdk.


If I do a Clean in AS, and then build, in the build output window, minus some starting lines, I see the sequence below. I’ve bolded the external dependencies, which if they aren’t in the right place, right name, should be throwing an error somewhere in the build output.

Task :app:extractCloudXRSDK
Task :app:extractOVRSDK
Task :app:extractOboeSDK
Task :app:preBuild
Task :app:preDebugBuild
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:generateDebugBuildConfig FROM-CACHE
Task :app:javaPreCompileDebug FROM-CACHE
Task :app:mainApkListPersistenceDebug FROM-CACHE
Task :app:generateDebugResValues FROM-CACHE
Task :app:generateDebugResources UP-TO-DATE
Task :app:mergeDebugResources FROM-CACHE
Task :app:createDebugCompatibleScreenManifests FROM-CACHE
Task :app:extractDeepLinksDebug FROM-CACHE
Task :app:processDebugManifest FROM-CACHE
Task :app:processDebugResources FROM-CACHE
Task :app:compileDebugJavaWithJavac FROM-CACHE
Task :app:generateJsonModelDebug UP-TO-DATE
Task :app:externalNativeBuildDebug
Build CloudXRClientOVR_arm64-v8a
[arm64-v8a] Prebuilt : libvrapi.so <= C:/p4cxr/sw/devrel/CloudXR/dev/android/client_app_ovr/app/build/ovr_sdk/VrApi/Projects/AndroidPrebuilt/jni/…/…/…/Libs/Android/arm64-v8a/Release/
[arm64-v8a] Prebuilt : liboboe.so <= C:\p4cxr\sw\devrel\CloudXR\dev\android\client_app_ovr\app\build\Oboe/prefab/modules/oboe/libs/android.arm64-v8a/
[arm64-v8a] Prebuilt : libCloudXRClient.so <= C:\p4cxr\sw\devrel\CloudXR\dev\android\client_app_ovr\app\build\CloudXR/jni/arm64-v8a/
[arm64-v8a] Prebuilt : libc++_shared.so <= /sources/cxx-stl/llvm-libc++/libs/arm64-v8a/

I deleted and uninstalled everything , then redid it again. After first building with ndk 20.0.5594570 as per Android Studio said it was the preferred ndk for the project I were then able to clean and build again with correct ndk. Thank you very much for the support!