Gradle setup for RajawaliVR with release or snapshot builds

This tutorial shows how to add the Android Gradle setup for Rajawali VR.

The Android build system compiles app resources and source code, and packages them into APKs that you can test, deploy, sign, and distribute. Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app. The Android plugin for Gradle works with the build toolkit to provide processes and configurable settings that are specific to building and testing Android applications.

Setup for RajawaliVR

Rajawali is a 3D engine for Android based on OpenGL ES 2.0/3.0.  RajawaliVR integrates the Rajawali 3D framework with the Google Cardboard SDK v0.6.0.

RajawaliVR used to be a separate module and now is moved to the main Rajawali repository on Github.

Getting started with RajawaliVR

Create a new project in Android Studio:

If you have just installed Android Studio or have no open projects then select Start a new Android Studio project.


If you have already have a project open, select File > New > New Project


Configure the Android VR project

Set the application name as needed. For this sample we used RajawaliVR.


In the next step, we select the target version. Make sure the Minimum SDK is at least 16 because the cardboard SDK only supports API 16 (Android 4.1 Jelly Bean) onward.


Android Studio also provides a set of predefined templates for Activity class. Select the activity for the app as needed. For this basic sample we selected ‘Empty Activity’


Set the Activity Name and click on Finish.


Setting up Gradle files

The project will have two build.gradle files one for the Project (RajawaliVR) and the other for the module (app). These can be seen in the Gradle Scripts section


To use the release/snapshot builds, open the Project build.gradle file:

Add the following to allprojects repositories:

This will allow Android Studio to connect to this Maven Server to retrieve a library.

Next we add the dependencies in the app module build.gradle file:

For release builds use:

Now we should see a note at the top asking you the sync the gradle. Click Sync Now and it should build. If it does not, you might want to recheck your code.

For snapshot builds use:

x.x.x is the version number (and the last number is the build number)

The latest release version as of this writing is 1.1.777 for both Rajawali and RajawaliVR. Snapshot version is 2.0.799 for Rajawali and 1.2.534 for RajawaliVR

Comments are closed.

Send Lesson #1
Join 1000s of VR Developers

Build your Career in VR with this 6 part FREE course

Send Lesson #1
Add Me To VIP
Join 1000s of VR Developers

We've build a simple curriculum to help you get started in VR

Send Lesson #1
We've launched a WebVR Course with 25+ projects with source code! Check it out.
Get The Course