cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble building samples for Mobile SDK v1.0.0 (fixed!)

mduffor
Protege
I'm trying to build the Mobile SDK v1.0.0's version of VrCubeWorld_NativeActivity under Linux (Ubuntu) with the command line tools, and have run into a bit of difficulty. The command line tools ran fine for SDK v0.6.2.0, but now that things are using Gradle there's some secret sauce I'm missing.

What I have so far:

Most of the text files in the SDK have DOS line endings, and need to be converted. Also, the scripts that come out of the zip file don't have execute permissions. Let's assume that ovr_sdk_mobile_1.0.0.0.zip is installed into ~/android/ovr_sdk_mobile, and the proper level of tools are installed (Andriod API 19, Build Tools v22.0.1). That gets us something like the following.

cd ~/android/ovr_sdk_mobile/VrSamples/Native/VrCubeWorld_NativeActivity/Projects/Android
chmod ug+x ./build.py
chmod ug+x ../../../../../gradlew

dos2unix build.py
dos2unix build.gradle
dos2unix settings.gradle
dos2unix AndroidManifest.xml
dos2unix jni/Android.mk
dos2unix jni/Application.mk
dos2unix ../../../../../gradlew
dos2unix ../../../../../gradle/wrapper/gradle-wrapper.properties
dos2unix ../../../../../settings.gradle
dos2unix ../../../../../build.gradle
dos2unix ../../../../../bin/scripts/build/ovrbuild.py
dos2unix ../../../../../cflags.mk

cp ~/Downloads/oculussig_whatever ../../assets/ <-- this is the signature file downloaded from the Oculus Dev site.

./build.py

This gets us most of the way there. All of the libraries build properly, but when the project itself tries to build we get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'assembleRelease' not found in root project 'VrCubeWorld_NativeActivity'.


This is from line 265 in bin/scripts/build/ovrbuild.py, where gradle is called with the "assembleRelease" directive. Alas, since build.gradle doesn't have a release buildType, we get the failure.


So what in the configuration is missing? Are the files in the SDK incomplete? Are there build instructions where something more than ./build.py needs to be run? Any suggestions?

Thanks for any and all help.

Cheers,
mduffor
21 REPLIES 21

emreyasa
Honored Guest
make: *** [obj/local/armeabi-v7a/objs-debug/openglloader/__/__/__/Src/gles3_loader.o] Error 2

:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildDebug'.
> Process 'command 'C:\Users\Master-Pc\AppData\Local\Android\android-ndk-r11c/ndk-build.cmd'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

abozeman8466
Honored Guest
I really wanted to try to go the Oculus path as opposed to Daydream but I cannot believe that I can't build an APK in Android Studio. I keep having the same problem building the NativeActivity sample. My gradle console output is below. Can anyone just give me hint on what I need to do?

Executing tasks: [:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:clean, :VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugSources, :VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAndroidTestSources, :VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mockableAndroidJar, :VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:prepareDebugUnitTestDependencies, :VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:assembleDebug]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildClean
[armeabi-v7a] Clean          : android_native_app_glue [armeabi-v7a]
[armeabi-v7a] Clean          : gnustl_shared [armeabi-v7a]
[armeabi-v7a] Clean          : gnustl_static [armeabi-v7a]
[armeabi-v7a] Clean          : vrcubeworld [armeabi-v7a]
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:clean
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:buildInfoDebugLoader
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:preBuild UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:preDebugBuild UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:checkDebugManifest
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:prepareDebugDependencies
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugAidl
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugRenderscript
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugBuildConfig
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugResValues
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mergeDebugResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:processDebugManifest
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:processDebugResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugSources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:preDebugAndroidTestBuild UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:prepareDebugAndroidTestDependencies
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugAndroidTestAidl
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:processDebugAndroidTestManifest
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugAndroidTestRenderscript
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAndroidTestBuildConfig
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAndroidTestResValues
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAndroidTestResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mergeDebugAndroidTestResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:processDebugAndroidTestResources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAndroidTestSources
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mockableAndroidJar UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:preDebugUnitTestBuild UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:prepareDebugUnitTestDependencies
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:initDeviceList()
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:OSigPreCheck SKIPPED
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:incrementalDebugJavaCompilationSafeguard
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugJavaWithJavac
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mergeDebugShaders
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:compileDebugShaders
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugAssets
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:mergeDebugAssets
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:processDebugJavaRes UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:transformResourcesWithMergeJavaResForDebug
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:packageInstantRunResourcesDebug
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:fastDeployDebugExtractor
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:generateDebugInstantRunAppInfo
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:checkManifestChangesDebug
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:transformClassesWithExtractJarsForDebug
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:transformClassesWithInstantRunVerifierForDebug
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:transformClassesWithDependencyCheckerForDebug UP-TO-DATE
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildDebug
make: Entering directory `C:/Users/abozeman/ovr_sdk_mobile_1.0.4/VrSamples/Native/VrCubeWorld_NativeActivity/Projects/Android'
[armeabi-v7a] Gdbserver      : [arm-linux-androideabi] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup       : libs/armeabi-v7a/gdb.setup
[armeabi-v7a] Compile thumb  : vrcubeworld <= VrCubeWorld_NativeActivity.c
[armeabi-v7a] Compile thumb  : android_native_app_glue <= android_native_app_glue.c

jni/../../../Src/VrCubeWorld_NativeActivity.c:63:10: fatal error: 'VrApi.h' file not found
#include "VrApi.h"
         ^
1 error generated.
make: *** [obj/local/armeabi-v7a/objs-debug/vrcubeworld/__/__/__/Src/VrCubeWorld_NativeActivity.o] Error 1
make: *** Waiting for unfinished jobs....

make: Leaving directory `C:/Users/abozeman/ovr_sdk_mobile_1.0.4/VrSamples/Native/VrCubeWorld_NativeActivity/Projects/Android'
:VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildDebug FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\abozeman\ovr_sdk_mobile_1.0.4\build.gradle' line: 99

* What went wrong:
Execution failed for task ':VrSamples:Native:VrCubeWorld_NativeActivity:Projects:Android:NDKBuildDebug'.
> Process 'command 'C:\Users\abozeman\AppData\Local\Android\sdk\ndk-bundle/ndk-build.cmd'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.575 secs