Showing results for 
Search instead for 
Did you mean: 

Android Studio unable to build any projects in SDK/Build instructions incorrect

Level 2

After spending probably 8 hours trying to install and configure Android Studio I have come to the conclusion that either the SDK or instructions for building any of the SDK samples are outdated.  Is there any plan to update the instructions for ones that might work?  For example, any instructions related to the NDK  or the "Project Structure" window is pretty much totally incorrect.  I have had to literally uninstall and re-install Android Studio 4 times today.  If I had to list specific errors, there would be at least 10 different mismatches and errors, like NDK is missing a "platforms" directory, Task 'prepareKotlinBuildScriptModel' not found in project, and many other unsolved/undocumented issues.


Level 2



Level 7

What instructions are you following? Are you referring to the Native Android Development Software Setup?


I see that under "Verify Installation of Correct Packages and Version" it tells you to install Android 8.0. This should be Android 10.0. Relevant link:


Regardless of which page it is, they each have a pair of buttons in the bottom left for reporting bugs and commenting on the quality of the page. I recommend submitting your feedback there so that it is routed to the correct team at Meta. 



Level 2

I am in the exact same situation as you: ovr_sdk_mobile looks outdated and cannot build out of the box with latest Android Studio (Chipmunk 2021.2.1 Patch 1).

The furthest I could get:

- add a stub in project's build.gradle: 

task prepareKotlinBuildScriptModel {


- remove line in to have C++ code compile

LOCAL_CFLAGS    += -Werror       # error on warnings

 - Refrain from upgrading android gradle plugin from 4.o to 7.2.1 (reached a dead end with gradle dependencies)

After this the project could sync gradle stuff but compilation fails after passing the build of the native lib on:
Execution failed for task ':VrSamples:VrCubeWorld_Framework:Projects:Android:compileDebugJavaWithJavac'.
> Failed to calculate the value of task ':VrSamples:VrCubeWorld_Framework:Projects:Android:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map( property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/Gerald/Downloads/ovr_sdk_mobile_1_original_WIP/VrSamples/VrCubeWorld_Framework/Projects/Android/build/generated/ap_generated_sources/debug/out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@313cfcdd) before task ':VrSamples:VrCubeWorld_Framework:Projects:Android:compileDebugJavaWithJavac' has completed is not supported

Level 2

same problem android studio 2021.2.1

Level 2

The same issue for me. All instructions are outdated, can't launch or even sync test project with SDK


I found solution and was able to sync the test project. As I tried to launch VrCubeWorld_Framework project so I'll describe things I did for that project (I believe it should be applied for any project you want to launch)

I opened VrCubeWorld_Framework only (not a root project)

1) Project Structure -> Modules -> set android ndk version (I set as 25.1.8937393)

Add ndk.dir to vr-sample file. That is optional thing, but you will not get additional warning

2) Set gradle version to 6.9.1. I tried to launch 7.6, but got an error

3) Copy gradle directory (with gradle wrapper inside) from root project (OculusSDK) to VrCubeWorld_Framework folder

4) add task for VrCubeWorld_Framework inside build.gradle

task prepareKotlinBuildScriptModel {


After that it synced succesfully and project tab was updated like this


Next step: I tried to "make a project" and got error. It said me "sdk 33.0.1 is corrupted, please, reinstall" (i use 33.0.1 sdk). In that case you need to go to your androidSDK/build-tools and copy dx.bat and lib/dx.jar from 29.0.2 sdk (it will be downloaded during sync if missing) to the same locations for your sdk build tools (33.0.1 in my case). I found this solution here but I did not replaced existing files, only added missing (to not break my 33.0.1 sdk tools)

After that I got error from cpp files like "this variable is declared, but not used"

I used solution provided by gerald.guyomard (thank you!)

- remove line in to have C++ code compile

LOCAL_CFLAGS    += -Werror       # error on warnings

After that on build project I got an error "keystore file not found for signing config 'debug'"

There are several solutions I found in Internet, I used next one:

Open git terminal and go to VrCubeWorld_Framework/Projects/Android

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
I filled needed fields in console and got debug.keystore file that should be renamed to android.debug.keystore
Adter that build -> make project was succeded. I didn't try yet to launch it on my oculus quest, will do it later

P.S.: don't change OculusSDK packaging and do not extract VrSamples as it uses "parent folder" to get needed files

P.P.S: I didn't try to make this project up-to-date to target sdk and other yet, that's just my guide how to build existing on