Using OpenGL causes a crash on Android 5, as soon as the openGL context is attached to a component, I'm getting this:
JNI ERROR (app bug): attempt to pass an instance of com.mycompany.myapp.myapp$OpenGLView as argument 1 to void com.mycompany.myapp.myapp.deleteView(com.mycompany.myapp.myapp$ComponentPeerView)
art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION : bad arguments passed to void com.mycompany.myapp.myapp.deleteView(com.mycompany.myapp.myapp$ComponentPeerView) (see above for details)
Any idea what could cause this ? The same code works in Android 4.x.
Thanks! I can add something along these lines, but the line numbers and files you're talking about don't match up with anything I see here.. Are you using an old version?
Indeed I'm using an older version, because it seems the newer Juce version has some other issues with Android 5, but they're probably all related to this kind of error (JNI call rejecteds by ART)
On the topic of OpenGL cleanup and shutdown on Android:
the OpenGLRenderer::openGLContextClosing callback is never called on Android.
The only place it is called is in OpenGLContext::CachedImageshutdownOnThread which is only called by OpenGLContext::CachedImage::run which is #if'd out on Android (JUCE_OPENGL_CREATE_JUCE_RENDER_THREAD not defined)
Cheers, Yair
(more info at http://www.juce.com/comment/309350#comment-309350)