[Android, UMF] MediaPlayer crashes on play

We’re getting a crash directly when trying to play a video, using Unreal Media Framework, on an HTC Android device with version 5.0.1.

The crash involves JNI, see example line below.

    JNI ERROR (app bug): attempt to use stale local reference 0x900001 (should be 0x200001)

We found in several stack overflow threads that the stale local reference issue is common after switching from older APIs to the newer ones.

We also noticed the same problem appearing on several Android 4.x devices when we deployed with minimum API version 14. Going back to API version 9 solves the problem, but not for Android 5.0.

Is it possible that the older API attempts to correct the stale reference by using backward compatibility, but that the feature may be gone in Android 5.0? Is this perhaps fixed in UE4.8? We are using Engine version 4.7.5.

See this text file with parts of the android log.

Some relevant log cat information

This is likely due to the issue mentioned on stackoverflow; there is likely a missing NewGlobalRef in the movie code which is why using the older version in compatibility mode is working.

This isn’t fixed in 4.8 at this time, but I’ll see if I can track it down and fix it before it is released.