Hello everyone,
I’m currently working on a cardboard VR project for Android. I’ve followed the instructions on the cardboard project page [GitHub - neph1/jme-cardboard: Google Cardboard integration for jMonkeyEngine 3] and set the BasicGame (the blue cube app) project up based on the instructions (added Android deployment, disabled compile on save and added the jme-cardboard.jar and cardboard.jar + created fragment and made MainActivity extend CardboardActivity + edited the main.xml file to point to the fragment).
The SDK shows no errors, all necessary files seem to be available. However when I run it on a phone (Samsung Galaxy S6 Edge) it crashes and gives me this error:
10-05 21:55:36.711 8637 8637 E AndroidRuntime: FATAL EXCEPTION: main
10-05 21:55:36.711 8637 8637 E AndroidRuntime: Process: com.mycompany.mygame, PID: 8637
10-05 21:55:36.711 8637 8637 E AndroidRuntime: java.lang.IncompatibleClassChangeError: The method ‘com.jme3.system.JmeContext com.jme3.app.Application.getContext()’ was expected to be of type virtual but instead was found to be of type interface (declaration of ‘com.jme3.app.CardboardHarnessFragment’ appears in /data/app/com.mycompany.mygame-1/base.apk)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at com.jme3.app.CardboardHarnessFragment.onCreate(CardboardHarnessFragment.java:46)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.Fragment.performCreate(Fragment.java:2242)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1141)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1245)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2218)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.FragmentController.onCreateView(FragmentController.java:98)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.Activity.onCreateView(Activity.java:6070)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:766)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:474)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.Activity.setContentView(Activity.java:2387)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at com.mycompany.mygame.MainActivity.onCreate(MainActivity.java:33)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6876)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:222)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.os.Looper.loop(Looper.java:158)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7229)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
10-05 21:55:36.711 8637 8637 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Does this mean that com.jme3.app.Application is not supposed to be an interface? Is this somehow linked to the fact that I use jME 3.1 beta1?
@rickard Do you think it is possible that cardboard support doesn’t work with the newer versions?
Does anyone have an idea about what the issue might be?
Thank you very much in advance,
Jalovius