Agora-Flutter-SDK icon indicating copy to clipboard operation
Agora-Flutter-SDK copied to clipboard

Agora not initialising on Flutter Web (TargetPlatform Error)

Open rutaba1 opened this issue 4 years ago • 4 comments

Hi, I am using this plugin on Flutter web. I am using agora_rtc_engine: ^4.1.0-alpha.2 and I also have AgoraRtcWrapper.bundle.js file in script tag. When I initialise SDK I get this error message on UI :

TargetPlatform.macOS is not yet supported by the plugin Screenshot 2021-12-25 at 2 09 04 AM

And in the logs I get this exception: MissingPluginException(No implementation found for method create on channel agora_rtc_engine)____../dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49 throw ../packages/flutter/src/services/platform_channel.dart 156:7 _invokeMethod ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 ../dart-sdk/lib/async/zone.dart 1362:47 _rootRunUnary ../dart-sdk/lib/async/zone.dart 1265:19 runUnary ../dart-sdk/lib/async/future_impl.dart 155:18 handleValue ../dart-sdk/lib/async/future_impl.dart 707:44 handleValueCallback ../dart-sdk/lib/async/future_impl.dart 736:13 _propagateToListeners ../dart-sdk/lib/async/future_impl.dart 542:5 [_completeWithValue] ../dart-sdk/lib/async/future_impl.dart 580:7 ../dart-sdk/lib/async/zone.dart 1354:13 _rootRun ../dart-sdk/lib/async/zone.dart 1258:19 run ../dart-sdk/lib/async/zone.dart 1162:7 runGuarded ../dart-sdk/lib/async/zone.dart 1202:23 callback ../dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop ../dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop ../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15

Here's my code for the initialisation:

_engine = await RtcEngine.createWithContext(
          RtcEngineContext(agoraDetailsModel.appId));
      await _engine.enableVideo();
      await _engine.startPreview();
      await _engine.setChannelProfile(ChannelProfile.LiveBroadcasting);
      await _engine.setClientRole(ClientRole.Broadcaster);

      await window.navigator.getUserMedia(audio: true, video: true);

      await _engine.joinChannel(
        agoraDetailsModel?.token,
        agoraDetailsModel?.channelName,
        null,
        0,
      );

I'm not sure if Im missing something why is it not working on flutter web.

rutaba1 avatar Dec 24 '21 21:12 rutaba1

pls follow the branch dev/flutter2

LichKing-2234 avatar Dec 26 '21 10:12 LichKing-2234

@LichKing-2234 I have, I added all steps necessary for web but still I'm getting not supported on macOS. I'm running this on Chrome

rutaba1 avatar Dec 26 '21 20:12 rutaba1

@LichKing-2234 I might be using wrong sdk version. Could you let me know what pre release version corresponds to dev/flutter2 branch please? I tried agora_rtc_engine: ^4.1.0-alpha.2 and agora_rtc_engine: ^4.2.0-rc.2 both didn't work

rutaba1 avatar Dec 27 '21 17:12 rutaba1

get our SDK by github, not the pub.dev

LichKing-2234 avatar Dec 28 '21 03:12 LichKing-2234

The web support for agora_rtc_engine 6.x has landed in the main branch, If you still face issues, please try the latest code in main branch to see if it works or not.

littleGnAl avatar Nov 14 '23 08:11 littleGnAl

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

github-actions[bot] avatar Nov 28 '23 09:11 github-actions[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

github-actions[bot] avatar Dec 05 '23 10:12 github-actions[bot]