Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Unable to start video broadcast #134

Open
sashabaranov opened this issue Feb 18, 2021 · 2 comments
Open

iOS: Unable to start video broadcast #134

sashabaranov opened this issue Feb 18, 2021 · 2 comments

Comments

@sashabaranov
Copy link

Hey guys,

I was following this tutorial and could not start a local video preview / broadcast.

The problem spot seem to be in:

let vidCode = agoraKit.enableVideo()
print("Video enable code: \(vidCode)")

It returns code -7 which as docs suggest indicates an error.

I've also tried to build your example from here and it also does not start. Not even a request for my camera. See screenshot attached.

photo_2021-02-18 18 39 00

@plutoless
Copy link
Contributor

@sashabaranov -7 means sdk is not yet initialized. have you put in the appid and token field as instructed in the readme?

@hvsw
Copy link

hvsw commented Aug 3, 2021

An error code can be a negative number. In such a case, it should be read as if it were positive. For example, if the SDK returns error code -2, you should refer to 2 in the error code table.

7 A method is called before the initialization of RtcEngine. Ensure that the RtcEngine instance is created and initialized before calling the method.

https://docs.agora.io/en/Interactive%20Broadcast/error_rtc?platform=iOS#warning-codes


I was using .xcframeworks and what was missing was the Agoraffmpeg.xcframework.

Interestingly, when using .xcframework the app would run just fine but fail “silently” with just this misleading -7 error code, while with .framework the app would crash on launch with a helpful message:

dyld: Library not loaded: @rpath/Agoraffmpeg.framework/Agoraffmpeg
  Referenced from: /private/var/containers/Bundle/Application/D3D2D968-ED95-4557-ABA5-F9D418B8131A/MyApp.app/Frameworks/AgoraRtcKit.framework/AgoraRtcKit
  Reason: image not found

Not sure if there’s something Agora can do on their side about this, but would be nice to have some informative troubleshooting message when there’s a missing .xcframework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants