As a bit of an Android n00b I've been having some problems compiling the samples which I have not much idea how to fix. I've followed the documentation step by step (I think).
First, gradle sync does not work, following the documentation for compiling the samples. It says to get the latest gradle version, which is 5.1.1 and does not have "leftShift" function for "<<" operator. It seems doLast {} is needed instead and I've had some success both with forcing gradle 4.10 and with modifying the gradle files to work with 5.1.1. So far so good ...
... except gradle sync never finished. It just spins doing nothing after a while. At this point Android Studio thinks there's a project and I can build it and it compiles code and stuff. However, there is no Configuration in the dropdown. It just says "Add Configuration". The docs expect there to be an Android configuration here but none appears. "Add Configuration" seems to be unhelpful too - there is no Module in the Module dropdown for Android App, and looking at some images online it seems Android Native App should be an option in Templates, but it does not appear. However, NDK is definitely ticked and installed, and the ANDROID_NDK_HOME points to the right place.
Does anyone have any clues where I'm going wrong here?
Well isn't that always the way. I think the problem is that I installed Android Studio for the first time ever yesterday. This version has an experimental feature "Sync Only Active Variant" which seems to be enabled by default. If you go to File->Settings->Experimental and untick this box, then reopen the project, and resync gradle, it seems to work. I now have the Android Configuration as expected.
How on earth did you figure this out? Thank you so much -- it solves being able to compile any VR sample on Windows. For those curious, the error is something along the lines of:
Gradle sync failed: Illegal char <:> at index 28: G:/ovr_sdk_mobile_1.29.0-2/G:-VrHands.iml (12 s 250 ms)
Unchecking the "Sync Only Active Variant" experimental feature in Android Studio resolves this.
Trying to compile *any* VRsample on Windows 10 / Android Studio 4.1.1 and failing horribly, even using the build.bat scripts fail with compilation errors , I have done the experimental sync only active variant unticking..
fcntl(): Bad file descriptor C:/OculusMobileSDK/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../VrSamples/SampleFramework/Projects/Android/jni/../../../Src/GUI/Fader.cpp:39:9: error: use of undeclared identifier 'assert' assert(fabs(fadeDelta) > MATH_FLOAT_SMALLEST_NON_DENORMAL); ^ C:/OculusMobileSDK/VrSamples/VrCubeWorld_Framework/Projects/Android/jni/../../../../../VrSamples/SampleFramework/Projects/Android/jni/../../../Src/GUI/Fader.cpp:125:13: error: use of undeclared identifier 'assert' assert(false); // this should never be called with state FADE_PAUSE