Open vaibhavbhus opened 4 days ago
@yeahren @maxxfrazer @littleGnAl @LichKing-2234 @devsideal @roip890 Please provide guidance on resolving this issue. Thank you.
It is most likely you referred to an outdated doc which caused the crash.
Initially, I encountered a MissingPluginException with the following message but the video call was working as expected: MissingPluginException(No implementation found for method show RPSystemBroadcastPickerView on channel example_screensharing_ios)
For this error, you also need to copy the MethodChannel
implementation on the native side
https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/blob/main/example/ios/Runner/AppDelegate.m#L23-L44
You've shared Objective-C code file link. SO I asked ChatGPT to convert the Objective-C code into Swift, I received the following Swift code:
let screensharingIOSChannel = FlutterMethodChannel(name: "example_screensharing_ios", binaryMessenger: controller.binaryMessenger)
screensharingIOSChannel.setMethodCallHandler { (call, result) in
if #available(iOS 12.0, *) {
DispatchQueue.main.async {
if let url = Bundle.main.url(forResource: nil, withExtension: "appex", subdirectory: "PlugIns"),
let bundle = Bundle(url: url) {
let picker = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 100, height: 200))
picker.showsMicrophoneButton = true
picker.preferredExtension = bundle.bundleIdentifier
for view in picker.subviews {
if let button = view as? UIButton {
button.sendActions(for: .allTouchEvents)
}
}
}
}
}
}
After adding this code to my AppDelegate.swift, I encountered the error "No such module 'Flutter'" and I'm unable to build the project.
I have also tried the following code
var screensharingIOSChannel = FlutterMethodChannel(
name: "example_screensharing_ios",
binaryMessenger: controller as! FlutterBinaryMessenger)
screensharingIOSChannel.setMethodCallHandler({
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
if #available(iOS 12.0, *) {
DispatchQueue.main.async(execute: {
if let url = Bundle.main.url(forResource: nil, withExtension: "appex", subdirectory: "PlugIns") {
if let bundle = Bundle(url: url) {
let picker = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: 100, height: 200))
picker.showsMicrophoneButton = true
picker.preferredExtension = bundle.bundleIdentifier
for view in picker.subviews() {
if view is UIButton {
(view as? UIButton)?.sendActions(for: .allTouchEvents)
}
}
}
}
})
}
})
still facing the same error of no such module found 'Flutter'.
Have you imported the Flutter
module like this?
https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/blob/79bf9974541b638fd7105385bece446ae8ab8328/example/ios/Runner/AppDelegate.swift#L2
yes
Did you run it in the command line?
yes I also tried to run it from command line and and from xcode on real device
Can you provide a reproducible demo so we can see what went wrong?
Version of the agora_rtc_engine
6.3.2
Platforms affected
Steps to reproduce
Expected results
The app should not crash and screen sharing should work as intended.
Actual results
Actual Behavior: The app crashes on the splash screen after implementing the changes.
I am facing an issue with screen sharing in Flutter specifically on iOS in video call. The feature works as expected on Android.
Initially, I encountered a MissingPluginException with the following message but the video call was working as expected: MissingPluginException(No implementation found for method show RPSystemBroadcastPickerView on channel example_screensharing_ios)
I followed the steps provided in the Agora documentation for screen sharing. (https://docs.agora.io/en/3.x/video-calling/basic-features/screensharing?platform=flutter) However, after implementing these changes, my app crashes on the splash screen.
Additional Information: Environment: Flutter version: 3.16.1 iOS version: 17.1.1 Agora SDK version: 6.3.2
Please provide guidance on resolving this issue. Thank you.
Code sample
Code sample
```dart import 'dart:ui' as ui; import 'package:Omniva/component/basic_video_configuration_widget.dart'; import 'package:Omniva/component/example_actions_widget.dart'; import 'package:Omniva/component/remote_video_views_widget.dart'; import 'package:Omniva/component/rgba_image.dart'; import 'package:agora_rtc_engine/agora_rtc_engine.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:permission_handler/permission_handler.dart'; import '../../../ids.dart'; /// ScreenSharing Example class ScreenSharing extends StatefulWidget { /// Construct the [ScreenSharing] const ScreenSharing({Key? key}) : super(key: key); @override StateScreenshots or Video
Screenshots / Video demonstration
https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/assets/174697940/a6b878e5-4d7f-4055-a663-5646212ec0caLogs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.16.9, on macOS 14.3.1 23D60 darwin-arm64, locale en-IN) • Flutter version 3.16.9 on channel stable at /Users/user/fvm/versions/3.16.1 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (5 months ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/user/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] Android Studio (version 4.2) • Android Studio at /Users/user/Downloads/android studio/Android Studio 4.2.2.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) [✓] Android Studio (version 2021.2) • Android Studio at /Users/user/Downloads/android studio/Android Studio chipmunk patch 1.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] VS Code (version 1.90.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0 [✓] Connected device (5 available) • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator) • Jenish’s iPhone (mobile) • 00008030-00110DDC0ED0802E • ios • iOS 17.5.1 21F90 • iMac’s iPhone (mobile) • 00008030-000325A91A90802E • ios • iOS 17.1.1 21B91 • macOS (desktop) • macos • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127 ! Error: Browsing on the local area network for HARDIK’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for Fenil’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for Tele’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for Pankit’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • All expected network resources are available. ```