I am trying to build the Quest 2 client with AndroidStudio but it is not working

Hello.

I am trying to build a client for Quest2 using the following URL
https://docs.nvidia.com/cloudxr-sdk/usr_guide/cxr_ovr_client.html

When I run “Sync project with Gradle Files” I get
“No variants found for ‘:app’. Check build files to ensure at least one variant exists.”

If “include ‘:app’” in “settings.gradle” is commented out, “Sync project with Gradle Files” succeeds.

But after that, “. \gradlew build” does not create “{sdk-root-folder}\Sample\Android\OculusVR\appapp\build” folder.

What is the problem with this?

(I am sorry. My English may be difficult to convey.)

One of the problems was the AndroidSDK version.
I was using the latest version, but when I changed to Android SDK 7.1.1 ‘Nougat’, the “Sync project with Gradle Files” succeeded.

However, I get the following error in the build.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':app:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
   > Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\Wentz\development\100_lab\502_cloudxr\quest\20220505CloudXR-SDK\Sample\Android\OculusVR\app\build\generated\ap_generated_sources\debug\out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@4aef4615) before task ':app:compileDebugJavaWithJavac' has completed is not supported

So a few things of note:

  1. yes, most of us here are NOT running the very latest android studio and tools. I personally prefer something older that is LTS, and has been stable for a while, so I’m still on a 2yo AS build, and older sdk and toolchain. But we also assume many customers historically don’t do frequent tool updates given the fact they often break projects. :)

  2. One thing I noticed from your second log was:
    C:\Users\Wentz\development\100_lab\502_cloudxr\quest\20220505CloudXR-SDK\Sample…
    Given windows path limitations, and gradle using short paths, you may run into path truncation issues. I’d recommend if possible trying something like "C:\cxrsdk" as your base path to the sdk. This is also achievable using symlinks/mounts, or directory junction on newer windows, and having the sdk root be something like R: or X: as a base.

I can’t guarantee the path length is the issue, but I do know it IS a real issue, and that path looks like the kind of thing that would overlow gradle limits at some point.