AndroidHarness - getting null pointer exception on start up

Hello,
I thought AndroidHarness is the best practice for creating Android apps with JME3 so I’m inheriting from AndroidHarness and get a null pointer exception:
10-03 08:50:53.608 17065-17065/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.scenemax.abware.scenemax, PID: 17065
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.scenemax.abware.scenemax/com.scenemax.abware.scenemax.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.jme3.system.JmeContext com.jme3.app.LegacyApplication.getContext()’ on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2583)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1499)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:683)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.jme3.system.JmeContext com.jme3.app.LegacyApplication.getContext()’ on a null object reference
at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:256)
at android.app.Activity.performCreate(Activity.java:6309)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2530)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1499)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:683)

Looking at the source code I see that AndroidHarness is crashing at this line (inside OnCreate):
this.ctx = (OGLESContext)this.app.getContext();

It means that for some reason, this.app is null
One thing I can think of is that AndroidHarness inherits from Activity and not from AppCompatActivity. Maybe this causes the exception while running on Android 6 devices (such as my device)?

What do you think?
Thanks
Adi

I think that you overrided the onCreate without calling it super.onCreate.

You should take a look to this post, it might help you.

Thanks for the answer -
I do have a super.OnCreate() call But I found a previous exception in the logs:
SEVERE Class jme3test.android.Test init failed
java.lang.ClassNotFoundException: jme3test.android.Test
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at com.jme3.app.AndroidHarness.onCreate(AndroidHarness.java:244)
at com.scenemax.abware.scenemax.MainActivity.onCreate(MainActivity.java:12)

Which JAR do i need to add to my project so it will find the jme3test.android.Test class?

Thanks,
Adi