stasel / WebRTC

Unofficial distribution of up to date WebRTC framework binaries for iOS and macOS
Other
356 stars 75 forks source link

M118 Undefined symbols:_OBJC_CLASS_$_RTCEAGLVideoView #83

Open cinRiggers opened 8 months ago

cinRiggers commented 8 months ago

use M117 or M118,project will call the error

ld: warning: Could not find or use auto-linked framework 'AudioUnit': framework 'AudioUnit' not found ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found ld: Undefined symbols: _OBJCCLASS$_RTCEAGLVideoView, referenced from: in SipCoreCenter.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

ddallabenetta commented 8 months ago

Same problem here, I am stuck at version M116 because of this error

stasel commented 8 months ago

Hey. Thanks for reporting. Can you also share what device/arc were you using when getting this error?

I had no errors on a x86_64 simulator and an iPad device

cinRiggers commented 8 months ago

Reference

To be precise,the issue occurs when your product contains The following code and it not related to device/arc. My device is iphone15 plus.

You can try run your project with this code inside: [[RTCEAGLVideoView alloc] initWithFrame:localView.bounds];

cinRiggers commented 8 months ago

First thank you for your attention to this issue.

To be precise,the issue occurs when your product contains The following code and it not related to device/arc. My device is iphone15 plus.

You can try run your project with this code inside: [[RTCEAGLVideoView alloc] initWithFrame:localView.bounds];

在 2023年10月23日 @.***> 写道:

Hey. Thanks for reporting. Can you also share what device/arc were you using when getting this error? I had no errors on a x86_64 simulator and an iPad device — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

dmi3j commented 8 months ago

Same problem for me on M1 Mac running app on simulator dyld[60652]: Symbol not found: _OBJC_CLASS_$_RTCEAGLVideoView Referenced from: <CCF49511-9C57-351E-A939-90CF1AA51CD5> /Users/XXX/Library/Developer/CoreSimulator/Devices/EFD7C5CE-9D2D-4CE9-8B1F-54EF0C7F1BCF/data/Containers/Bundle/Application/17B6A96C-1B93-4643-B4D9-5F2E57FECD4D/myApp.app/Frameworks/MVWebRTCInterface.framework/MVWebRTCInterface Expected in: <4C4C4413-5555-3144-A171-F77BC8033BEF> /Users/XXX/Library/Developer/CoreSimulator/Devices/EFD7C5CE-9D2D-4CE9-8B1F-54EF0C7F1BCF/data/Containers/Bundle/Application/17B6A96C-1B93-4643-B4D9-5F2E57FECD4D/myApp.app/Frameworks/WebRTC.framework/WebRTC

Manraj45 commented 8 months ago

The issue is still present in version 119.0.6045.41 of WebRTC. Seems like the versions after M116 are missing the RTCEAGLVideoView.o.

In M116: image image

In the latest versions: image

cinRiggers commented 8 months ago

Yes,it is still in version M120 Beta. Seems the official using RTCMTLVideoView instead of RTCEAGLVideoView.I don’t know it’s bug or not.

Manraj45 commented 8 months ago

@cinRiggers I didn't find any documentation stating that they deprecated RTCEAGLVideoView. It would be nice if we have had an official confirmation before starting to replace RTCEAGLVideoView with RTCMTLVideoView.

cinRiggers commented 8 months ago

So the best solution right now is using below M116 version? I really can't finger out other solutions. Crying...

cinRiggers commented 8 months ago

So the best solution right now is using below M116 version? I really can't finger out other solutions. Crying...

在 2023年10月27日 20:18,Manraj @.***> 写道:

@cinRiggers I didn't find any documentation stating that they deprecated RTCEAGLVideoView. It would be nice if we have had an official confirmation before starting to replace RTCEAGLVideoView with RTCMTLVideoView. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Manraj45 commented 7 months ago

@cinRiggers I created a ticket in the WebRTC forum, we can follow this ticket for now to see if there is any update: https://bugs.chromium.org/p/webrtc/issues/detail?id=15655

DePasqualeOrg commented 6 months ago

I'm also getting this error with RTCMTLNSVideoView on macOS with M117 and later.

adozenlines commented 6 months ago

Has anyone with Apple Silicon enabled Rosetta support in Xcode?

adozenlines commented 6 months ago

This error is because these views are UIKit-based views and will be absent from a native macOS build because they are not AppKit-based views. If you're targeting macOS, your best bet will be to use macCatalyst to use UIKit views in an AppKit environment.

open class RTCEAGLVideoView : UIView, RTCVideoRenderer {

    weak open var delegate: RTCVideoViewDelegate?

    public init(frame: CGRect, shader: RTCVideoViewShading)

    public init(coder aDecoder: NSCoder, shader: RTCVideoViewShading)

    /** @abstract Wrapped RTCVideoRotation, or nil.
     */
    open var rotationOverride: NSValue?
}
DePasqualeOrg commented 6 months ago

But RTCMTLNSVideoView is not a UIKit view, right? This view works natively on macOS for me with M116, but not with later versions of the WebRTC package.

ragul-m46 commented 5 months ago

I am still facing this issue on version M117 and later, and I run on a M1 Pro MacBook, have you guys found a solution yet ? I don't see any suggestions to this on the webRTC bugs page too "https://bugs.chromium.org/p/webrtc/issues/detail?id=15655" . Kindly let me know if you have a work around to this!

DePasqualeOrg commented 5 months ago

I posted a bug report too, but got this response a few hours ago:

We do not support unofficial libraries/packages/forks of webrtc.

It sounds like the problem might be the way this package is being built. Can someone familiar with the build process check if RTCEAGLVideoView and RTCMTLNSVideoView are included during the build?

ragul-m46 commented 5 months ago

Hey @DePasqualeOrg , I checked the files during the build, looks like both RTCEAGLVideoView and RTCMTLNSVideoView are available, but I have no clue why we get this undefined symbols issue..., I have been stuck with this for the past one month now..., I very badly want to push to the M120 version, but I am stuck at M116! Somebody please help me with this...Crying already...I also tried building the RTCEAGLVideoView manually, but still came back to the same issue....

ragul-m46 commented 5 months ago

@stasel I also tried your generated frameworks for comparison.., till M116 it works fine, but on M117 and later versions I am getting the same undefined symbol issue using your framework, can you share your thoughts on this please...

Device information: MacBook M1 Pro - Sonoma 14.1.1 iPhone 12 Pro - iOS 16.3.1 Xcode 15

ragul-m46 commented 5 months ago

Yooo guys! I did find a work around to this, leave me a message with the version that you are trying to build, I can help you with the fix..! This issue occurs because the OpenGL ui objc doesn't get added to the dependencies properly during the build process, the fix is quite simple and straight forward, let me know if you need my help!

DePasqualeOrg commented 5 months ago

@ragul-m46, could you share more details on the fix? Would this also fix the issue with RTCMTLNSVideoView?

Manraj45 commented 5 months ago

@ragul-m46 Could you post the workaround for version 120.0.6099.119 (Basically the latest stable build). Thanks

ragul-m46 commented 5 months ago

Hey @DePasqualeOrg , I am not sure if this would fix the issue on Metal renderer, cause the issue I was facing was with OpenGL

ragul-m46 commented 5 months ago

Hey @Manraj45, try comparing the Build.gn file at src/sdk between M120 and M116 or older, you will find the problem, it should be missing the OpenGL UI ObjC dependency., add it to that to fix the issue..

DePasqualeOrg commented 5 months ago

Given that these two issues occurred around the same time, I think it's likely that changes in the build script that happened after M116 are also affecting RTCMTLNSVideoView.

stasel commented 4 months ago

Hi everyone, apologies for the late response. Unfortunately I don't have a lot of capacity to work on this project :( Thanks everyone for your input. It looks indeed that the sdk/BUILD.gn got changed and may caused the issue.

I haven't changed the build script for a while. I also tend to not touch any sources or build files unless I really have to.

Looking a the file I have noticed a flag:

          if (rtc_ios_macos_use_opengl_rendering) {
            deps += [ ":opengl_objc" ]
          }

Maybe we can try to include this build flag to add opengl back? I can try to create a new build and share it here if anyone interested to test.

Edit: It looks like this flag is on by default. So I am not quite sure how to fix the issue. Any suggestions?

ragul-m46 commented 4 months ago

Yes @stasel, this was the exact fix I used to solve the issue! I think it's time to close this issue! There is a small change, the variable name has been changed as OpenGL does not support macOS now, it should be as follows: if (rtc_ios_use_opengl_rendering) { deps += [ ":opengl_objc" ] }

DePasqualeOrg commented 4 months ago

Can someone familiar with the build script check to see why RTCMTLNSVideoView for macOS is also not included after M116? Is there another flag that needs to be set?

stasel commented 4 months ago

It appears that the rtc_ios_use_opengl_rendering flag is on by default. Turning it on explicitly doesn't seems to make any difference.

In my iOS example code, I am using RTCMTLVideoView instead of RTCEAGLVideoView and everything compiles and works alright.

DePasqualeOrg commented 4 months ago

@stasel, the "undefined symbols" error only happens for me when building a native macOS app. I noticed that your example app is configured with "Designed for iPad" on macOS, so it's essentially running the iOS version on Mac.

DePasqualeOrg commented 3 months ago

@stasel, is it possible that the framework is only being built for iOS? I'd really like to resolve this longstanding issue, since I get the "undefined symbols" error in every version after M116 when building native macOS apps.

diogoviannaaraujo commented 3 months ago

Just got on that after trying to use the library on a native Mac app.. Everything works, been able to create a successful connection, but when trying to display the video I found RTCMTLNSVideoView and it seemed like the correct option.. No luck, when adding I get linked errors like described earlier.

If its just some build script changes we could create a patch file and apply on GitHub Actions before build...

DePasqualeOrg commented 3 months ago

I came across this comment on Stack Overflow:

Add the argument rtc_enable_symbol_export=true in your gn gen and generate your framework again, it should work.

Could this be the solution?

@stasel, any help you can offer on this longstanding problem would be much appreciated.

stasel commented 3 months ago

Worth trying. I have triggered a new build with this flag enabled: https://github.com/stasel/WebRTC/actions/runs/8443223499

Once it's done, can anyone check if the new build solves the issue?

stasel commented 3 months ago

The new build is ready. This has the rtc_enable_symbol_export set to true.

I have uploaded the artifact here: https://www.dropbox.com/scl/fi/a5tc2rfo1noje02x09zo0/WebRTC.xcframework.zip?rlkey=r8ey0j1fg8jc2dqagza0fwdwi&dl=1

@DePasqualeOrg Can you try that build to see if it fixed the issue?

yolkin commented 3 months ago

@stasel still not fixed for me

Снимок экрана 2024-03-27 в 11 53 26 Снимок экрана 2024-03-27 в 11 55 08

Device information: MacBook Pro 16" Intel Core i9 - Sonoma 14.3.1 iOS 17.4 Simulator (x86-64) Xcode 15.3

DePasqualeOrg commented 3 months ago

@stasel, how do I add this to my project? I added it to "Link binary with libraries", and it appears in my "Frameworks" folder, but when I run the app, it crashes with this error: dyld[5330]: Library not loaded: @rpath/WebRTC.framework/WebRTC

DePasqualeOrg commented 3 months ago

@yolkin, did you use the latest build (M123) or the one I'm trying to use? Did you clean you build folder first? I got this same error when using the one linked to above, until I cleaned my build folder, so maybe it was still using the official version.

yolkin commented 3 months ago

@DePasqualeOrg the latest (M123). Tried to clean build folder.

DePasqualeOrg commented 3 months ago

@yolkin, we're trying to test the build flag that was changed on the special build linked to above, not the release version. That's been broken on Mac since M117.

yolkin commented 3 months ago

Still have the issue with the dropbox build. Tried to clean build folder and derived data.

DePasqualeOrg commented 2 months ago

M124 is still broken in native macOS apps, with "undefined symbols" errors at build time. And when building a native macOS app with M116, the last working version, I get the following warnings. Note that I'm not using the OpenGL resources in my app at all.

RTCNSGLVideoView.h
'NSOpenGLView' is deprecated: first deprecated in macOS 10.14 - Please use MTKView instead.
'NSOpenGLPixelFormat' is deprecated: first deprecated in macOS 10.14 - Please use Metal or MetalKit.

Presumably a future version of macOS will not include the deprecated resources, and then apps that use this library will be broken. This is a critical bug that needs to be fixed before it's too late.

DePasqualeOrg commented 2 months ago

@stasel, could it have to do with building for ARM7, where Metal is not available?

DePasqualeOrg commented 1 month ago

Perhaps related, and still unresolved: https://groups.google.com/u/1/g/discuss-webrtc/c/qgZvTmE6TGQ/m/-Lb8GdhuAAAJ

yolkin commented 1 month ago

Are there any updates for x86_64? Still can't build for an iOS simulator with an Intel-based Mac.

ld: warning: Could not find or use auto-linked framework 'AudioUnit': framework 'AudioUnit' not found
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RTCEAGLVideoView", referenced from:
       in VideoCallViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
tikhonp commented 1 month ago

Same problem when building for macOS target with MacBook Pro 14" M2 Pro (Sonoma 14.5), Xcode 15.4 using latest M125:

ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RTCMTLNSVideoView", referenced from:
       in VideoConference.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
DePasqualeOrg commented 1 week ago

This is still broken in M126.