RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

Crash since using 2019.4.x running on Android 7 #428

Closed jason-yak closed 3 years ago

jason-yak commented 3 years ago

We seem to have developed a crash issue with our app running on Android 7. The issue is not happening on Android 6, I'm not sure if this affects other OS versions or not. Some info to help narrow down the issue:

So on the Android 6 device running the same build, we play a vid that's worked for years and it plays and logs this correctly: [AVProVideo] Creating player 0 [AVProVideo] Initialising AVPro Video (script v1.11.3 plugin v1.11.3) on Adreno (TM) 330/OpenGL ES 3.0 V@140.0 AU@ (GIT@Ia10634f51b) (MT True) on Android Android OS 6.0.1 / API-23 (MMB29M/G900IDVU1CQD1) [AVProVideo] Opening jar:file:///data/app/co.yakand.udp.agentaapuzzleindisguise-1/base.apk!/assets/EN/c1_Intro_ns@SD.mp4 (offset 0) with API MediaPlayer

But on our Android 7 device it crashes with this log: AndroidJavaException: java.lang.VerifyError: Verifier rejected class com.RenderHeads.AVProVideo.AVProMobileVideo: com.RenderHeads.AVProVideo.AVProVideoPlayer com.RenderHeads.AVProVideo.AVProMobileVideo.CreatePlayer(int, boolean, boolean, int, boolean) failed to verify: com.RenderHeads.AVProVideo.AVProVideoPlayer com.RenderHeads.AVProVideo.AVProMobileVideo.CreatePlayer(int, boolean, boolean, int, boolean): [0x2F] cannot access instance field boolean com.RenderHeads.AVProVideo.AVProVideoPlayer.m_bShowPosterFrame from object of type Unresolved Reference: com.RenderHeads.AVProVideo.AVProVideoExoPlayer (declaration of 'com.RenderHeads.AVProVideo.AVProMobileVideo' appears in /data/app/co.yakand.udp.agentaapuzzleindisguise-2/base.apk)

I've done some snooping into what's happening and found some interesting results. So we have a version of our game live on Google Play, when I run this build on the Android 7 device this build runs totally fine. I checked and this build was using v1.10.2 of AVPro at the time it was compiled and it was using Unity 2019.3.9. So this still runs without issue. This morning I was also using v1.10.2 in Unity 2019.4.2 and it doesn't work. I don't think the Android SDK has changed on my machine (at least for Android 7) since the build was used to compile the working live version. So basically Unity is the only thing that's changed. I could roll back the project and use 2019.3.9 if we have to, it could help further narrow down where the issue has started. But let me know if this rings any bells with you on what could be happening? thanks!!

Any ideas what we should try? or let me know if there's anything we can do to help debug this issue.

Ste-RH commented 3 years ago

Sorry you are seeing this. I hope we can get to the bottom of it asap.

I see you are using the MediaPlayer API for playback. Have you purposefully removed the ExoPlayer library files due to a clash with another library? (usually something like Oculus)

Ste-RH commented 3 years ago

I have tested the following setup here:

Everything plays back as it should.

Ste-RH commented 3 years ago

A bit more info. If I mark the ExoPlayer library files 'not for Android' then I can reproduce the error you are seeing.

jason-yak commented 3 years ago

Thank you so much for looking into this, I just checked and the 5 jar files in our project that exo in their name are all set to android only in the import settings so I don’t think it’s that. Note I had also performed a totally clean install of avpro running resolver of course. I don’t have the trial version though, we’ve been using the full version for years. Not sure where the issue is creeping in.

Jason Rawlings

Director of Yak & Code

www.yakand.co

On 29 Jul 2020, at 8:53 pm, Ste Butcher notifications@github.com wrote:

 A bit more info. If I mark the ExoPlayer library files 'not for Android' then I can reproduce the error you are seeing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jason-yak commented 3 years ago

And no I haven’t removed any files from the install, exoplayer is there.

Jason Rawlings

Director of Yak & Code

www.yakand.co

On 29 Jul 2020, at 7:50 pm, Ste Butcher notifications@github.com wrote:

 Sorry you are seeing this. I hope we can get to the bottom of it asap.

I see you are using the MediaPlayer API for playback. Have you purposefully removed the ExoPlayer library files due to a clash with another library? (usually something like Oculus)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Ste-RH commented 3 years ago

That is very strange...it is removing the ExoPlayeer library files that meant I could reproduce the error.

I have put a possible fix in (at least it fixes the reproduction of the issue here) and this will make it out into release 1.11.4 later today. I will post back when it has been released...if you could then test your side and report back, that would be great.

AndrewRH commented 3 years ago

1.11.4 trial is available here: https://github.com/RenderHeads/UnityPlugin-AVProVideo/releases/tag/1.11.4 The full version will be available on the store in a few hours

jason-yak commented 3 years ago

It is strange, I've just compiled using the 'export project' so I could see exactly what jar files are being included in the build and it does appear the exoplayer is being excluded. I have no idea why though. This is the compiled libs folder: https://www.dropbox.com/s/vf289ldtt9ppcm1/Screen%20Shot%202020-07-30%20at%2010.31.02%20am.png?dl=0

and here's some grabs of it in my project and import settings for sanity checking: https://www.dropbox.com/s/qisygshswyoj03s/Screen%20Shot%202020-07-30%20at%2010.34.47%20am.png?dl=0 https://www.dropbox.com/s/lpqyqofrmtm7toh/Screen%20Shot%202020-07-30%20at%2010.34.57%20am.png?dl=0

I'll try this new update and see if this improves anything, but it does seem like something is preventing the exoplayer from being built in. I've searched my code base and nothing is touching it.

jason-yak commented 3 years ago

So I've tried the new 1.11.4 update and yup this fixes my error on Android 7, thank you. To make sure I retested the build before this with the older plugin and it errors, using the new one it works fine.

But I'm still just a little worried about the exoplayer libs not being compiled into the apk though. To be honest I don't know what exoplayer is, are there any device types or Android versions that require this? We're wanting to support armv7 and armv64 architectures and api's 23 to 28 if that's at all relevant, and I only ever play videos in AVPro using the one MediaPlayer method. So I'm just wondering if there's any reason to be concerned that it's excluded? and I'm just a bit confused by the older plugin needing it to be there for vids to work properly on Android 7 but now doesn't need it in the new plugin update, thanks again.

Ste-RH commented 3 years ago

I am not hearing anything to be worried about 👍