Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity Crash on MacOS when the join method is invoked (Agora.io)

I downloaded the agora.io video sdk asset from the asset store, imported it to a new project. On the demo "SceneHome" scene, I entered the api id. Clicked play, and as soon as I click the "join" button Unity crashes. As far as I can tell the crash happens on the

app.join(field.text);

line in the TestHome.cs script (line #86).

I tested it in 2019.3.2f1 and 2020.1.0b5. The result was the same. The OS is Catalina 10.15.4.

The demo works on Windows.

I followed this tutorial: https://medium.com/@jake_agora.io/mac-run-video-chat-within-your-unity-application-e001091db62f but used x86_64 dlls instead of x86

Does anyone know what this is about? Or where should I begin to look?

Another tutorial, this one from Agora:

https://www.agora.io/en/blog/run-video-chat-within-your-unity-application-mac

like image 474
Anton Avatar asked Apr 16 '20 17:04

Anton


2 Answers

It can be caused by missing the Camera and Microphone usage in the Unity Editor project setting. Please let us know if that's the case. (I saw you are also on the Slack channel, let's continue the conversation there.).

enter image description here

For the people who didn't know, Agora Developer Community - Unity Chat channel is here :)

like image 116
Rick Cheng Avatar answered Nov 14 '22 13:11

Rick Cheng


As herve nau pointed out the problem was that the Unity did not had the permission to use camera or microphone. And the solution should work. Alternatively, here is another way to add the permission as described by launzone:

1) Disable SIP: Go into recovery mode (hold CMD+R when you

restart your Mac) Don't be afraid, we are not doing anything crazy.

2) After that open Terminal (it should be accessible from one of the Menus at the Top) Type in "csrutil disable" and hit enter. Then reboot your Mac normally.

3) Open Terminal and type in: "sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db" and hit enter

4) For microphone access, type in: "INSERT INTO access VALUES('kTCCServiceMicrophone','com.unity3d.unityhub',0,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);" and hit enter

For camera, type in: "INSERT INTO access VALUES('kTCCServiceCamera','com.unity3d.unityhub',0,1,1,NULL,NULL,NULL,'UNUSED',NULL,0,1541440109);" and hit enter

6) check in your SystemPreferences/Security&Privacy > unity hub should now show up in both mic and cam

7) reboot in recovery mode again (CMD+R), open terminal again, type in: "csrutil enable" and hit enter, to enable SIP again

8) reboot normally and enjoy!

Here is the full thread. I hope it helps someone :)

like image 35
Anton Avatar answered Nov 14 '22 14:11

Anton