We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I've tried a cardboard example code from android.processing.org. Compiling process was ok, but when the sketch launched on a device it didn't work. TIA
swann
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: http://android.processing.org/install.html 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 java.io.File.getAbsolutePath()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7406) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' 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(MainActivity.java:14) at android.app.Activity.performCreate(Activity.java:6904) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266) ... 9 more
Answers
Problem solved! 4.0 beta7 android mode changed cardboard library to vr library :) It works perfectly for now.
@swann -- thanks for sharing your solution!