AgoraIO-Community / Agora-Unity-RTM-SDK

A Unity3D sample app to show Login /Logout, Log in to/out of channel, Get Channel Member Count, Send/Receive Channel Message, Send Peer Message, Query Member, and token Authentication
24 stars 15 forks source link

Failure when calling JoinChannel in project containing Firebase libraries (on iOS) #33

Open diegoleao opened 3 years ago

diegoleao commented 3 years ago

Hi! I have a project that works with both RTC and RTM libraries together, but, when I add Firebase, I get this error EXC_BAD_ACCESS on RTMNotificationThread (always when I execute JoinChannel): image

At first, we thought that it was because of the bug described here: https://github.com/AgoraIO-Community/Agora-Unity-RTM-SDK/issues/19 So we did rebuild the Unity RTM SDK from the latest tag AND trunk, copied both it and the folder from step 2. (as instructed in that issue solution), no luck, same error occurs.

So to be extra clear:

It is only when we add Firebase AND RTM to our project that it starts throwing this error.

If not a full solution, can you propose a hotfix for this? We're due to launch in a week and are considering removing RTM from our project, since we already spent a lot of time of the team trying to narrow down and fix this issue :\

Working Project (RTC + RTM): [edit: removed to avoid confusion, since it was just a project working normally]

Project Not Working (RTC + RTM + Firebase): https://drive.google.com/file/d/16kRFaLg3k1f_xgnDKJX-lqcv37M6/view

EDIT: This issue only happens on iOS, on Android it always worked perfectly.

zhangtao1104 commented 3 years ago

OK, We will check this issue.

diegoleao commented 3 years ago

Thanks! I forgot to mention this issue only happens on iOS. The image kind of alludes to that, but I really should have specified. Let me know if you need any testing while fixing the issue, or any further information.

YiqingJackieHuang commented 3 years ago

Hi @diegoleao! I took a glance at your project, but I did not find any scene containing all the SDKs required as you mentioned above, and calling these bug-lead APIs. May you kindly provide me with a simple demo for debugging?

diegoleao commented 3 years ago

Hi @YiqingJackieHuang ! Maybe you looked at the link with the working project, not the one with the error? One of the links I sent is working normally, I just provided it as an example to compare with the one that breaks.

The one that FAILs on JoinChannel() execution on iOS is this (NotWorkingProject.zip): https://drive.google.com/file/d/16kRFaLg3k1f_xgnQiADDKJX-lqcv37M6/view

Also, you don't have to call Firebase for the error to happen, just having Firebase in the project is enough for JoingChannel() to break. Just add it to the project, and JoinChannel() won't work anymore (on iOS, in the editor it will work).

image

The test scene is "AgoraEngine/Demo/SceneHome.unity" (we just adapted it to have both RTC and RTM). Once that scene is loaded on your device, you can just:

diegoleao commented 3 years ago

Bellow is a video of "SceneHome.unity" running, and we show you how to reproduce the error: https://youtu.be/mZcQrNnEzR0

YiqingJackieHuang commented 3 years ago

Hi @diegoleao! I have successfully set up the project as you showed and met the same problem as you described. I will dig deeper into the bug and give you feedback as soon as possible.

diegoleao commented 3 years ago

Hi @YiqingJackieHuang did you find anything on this issue? A workaround would suffice for now! Thank you!

YiqingJackieHuang commented 3 years ago

Hi @diegoleao! When digging deeper inside, I found that this issue is caused by our iOS SDK, which means I cannot investigate it by myself without the source code. I am raising this problem to our iOS SDK development team and I will cooperate with them to solve this problem. If there is any update, I will leave a message here. I sincerely apologize for the inconvenience and thanks for your patience.

diegoleao commented 3 years ago

Ok! I removed the link to our project as to not share our URLs for too long, but by now you have it and was already able to reproduce, so I think it is not needed anymore ;) Thanks again

william821114 commented 2 years ago

We meet the same issue when using RTC(unity v3.5.0.3) + RTM(unity v1.4.8) + Firebase(8.7.0) on iOS.

image

Any updates on a fix for this @YiqingJackieHuang? If there's no fix planned, can you suggest a workaround we could implement?