thanh-nguyen-kim / Unity_Android_Screen_Recorder

A simpler demo record screen plugin for record Android Screen
GNU General Public License v3.0
101 stars 36 forks source link

Stop failed :( #6

Closed Naphier closed 5 years ago

Naphier commented 5 years ago

AndroidPlayer(Google_Pixel_2@192.168.1.10)</i> 20190819-19:58:59 EXCEPTION UnityEngine.AndroidJavaException: java.lang.RuntimeException: stop failed.

Not sure why this is happening.

Full logcat: new 2.txt

Naphier commented 5 years ago

So I've done a variety of debugging and it seems on some devices that the MediaRecorder just isn't initializing. I added in the onError listener and it frequently just says MEDIA_ERROR_SERVER_DIED. Apparently Google in their infinite wisdom decided this was enough information because all the other error codes have no reference. So this happens about 99% of the time on my Pixel 2 and Samsung 8 and 9 devices. On our LGV30 it seems to run just fine. They're all running android 8. Maybe someone out there in the void has a clue?

thanh-nguyen-kim commented 5 years ago

Hi Naphier. It look like you have the signal 11 error. This error mostly cause by your game call to the java side up on resume from an ad network(i have the problem with Admob). You might have to delay the call to load ads, show ads for 1 second and recheck if the problem has been solved. If the problem still occur, deleted my plugin(my plugin might cause the problem in newer android version, google change many things when release a new android version) Have a good day.

Naphier commented 5 years ago

No admob in our app, you're looking at lines to an unrelated app's issue. Ours is the unity app (PID 19104). You can see your plugin init at line 7497 You can see that your plugin inits, supposedly starts recording then around line 7565 it seems to fail. Seeming to be an issue with mediacodec. Others are still using screen recording in android 8+. Are you aware of any methods to determine the proper codecs or something?

Don't want to delete your plugin. It's like the only one that even tries to record screen on android :( AVPro doesn't even support anymore (probably because this is too painful 😛 ) thanks

thanh-nguyen-kim commented 5 years ago

have you build the example project. does it have the problem in this device? If it cause too much pain, you can buy the "natcorder plugin" in the store. i dev my plugin before the natcorder era.

Naphier commented 5 years ago

Yeah, I didn't realize Natcorder now does this. We will use that. I think the issue is somewhat related to changing scenes in Unity. But once it fails even retry through the java script doesn't work. Thanks

thanh-nguyen-kim commented 5 years ago

Yep. You should avoid change scene during record. This task is very resource-intensive and will break the record process. Best regards Tee