Cardboard example code doesn't work on a device

edited May 2017 in Android Mode

I've tried a cardboard example code from Compiling process was ok, but when the sketch launched on a device it didn't work. TIA


Device Samsung Galaxy Tab E 8.0 (Android 6.0.1)

Processing version 3.3.2

Android mode Version pre 4.0 beta7 (260)

Operating system OSX 10.11.6

Target APIs you have tried (Installed through the Android SDK manager and visible in the Processing IDE Android mode) Android SDK version. Did you install it yourself or using the automatic installation offered by the Processing IDE android mode? manual installation(Android Studio / update SDK-tools to 25.2.5) SDK path : ~/Library/android/sdk

Have you run Android apps in Processing before? In any other SDK like Eclipse or Android Studio (AS)? Yes in Processing

Is this your first time? Did you enabled the developer mode in your device? Yes

did you check the following website as a reference: Did you try any other set of instructions? Which ones? Can you provide your link? Yes

Are you running your app in an actual device or through an emulator? (NOTE: It is strongly recommended to do it on an actual device) Yes

Have you activated the debug mode on your phone + what is your phone OS ? ) + give us more error code (not only the first 2 lines) Yes

Processing code:

import processing.vr.*; import processing.cardboard.*;

void setup() { fullScreen(PCardboard.STEREO); }

void draw() { }

error code:

FATAL EXCEPTION: main Process: processing.test.sketch_170501a, PID: 13617 java.lang.RuntimeException: Unable to start activity ComponentInfo{processing.test.sketch_170501a/processing.test.sketch_170501a.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String' on a null object reference at at at$1100( at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invoke(Native Method) at$ at Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String' on a null object reference at processing.core.PApplet.initSurface(Unknown Source) at processing.core.PApplet.initSurface(Unknown Source) at processing.vr.PVR.setSketch(Unknown Source) at processing.test.sketch_170501a.MainActivity.onCreate( at at at ... 9 more



  • Answer ✓

    Problem solved! 4.0 beta7 android mode changed cardboard library to vr library :) It works perfectly for now.

  • @swann -- thanks for sharing your solution!

Sign In or Register to comment.