AgoraIO-Community / VideoUIKit-Flutter

Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.
https://agora-flutter-uikit.vercel.app/
MIT License
138 stars 75 forks source link

layoutType: Layout.floating error on hostcontrol and pin #163

Open BulbulH opened 10 months ago

BulbulH commented 10 months ago

E/FrameEvents(18167): updateAcquireFence: Did not find frame. D/CCodec (18167): ISConfig not changed D/CCodecConfig(18167): c2 config diff is c2::u32 coded.bitrate.value = 599000

======== Exception caught by gesture =============================================================== The following _TypeError was thrown while handling a gesture: Null check operator used on a null value

When the exception was thrown, this was the stack:

0 hostControl (package:agora_uikit/controllers/rtm_mute_request.dart:28:41)

1 _HostControlsState.build.. (package:agora_uikit/src/layout/widgets/host_controls.dart:34:15)

2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)

3 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654:11)

4 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311:5)

5 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:281:7)

6 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:167:27)

7 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:469:20)

8 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:445:22)

9 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:331:11)

10 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:400:7)

11 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:363:5)

12 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:320:7)

13 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:293:9)

14 _invoke1 (dart:ui/hooks.dart:158:13)

15 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:382:7)

16 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)

Handler: "onTap" Recognizer: TapGestureRecognizer#cbbc7 debugOwner: GestureDetector state: ready won arena finalPosition: Offset(125.8, 110.2) finalLocalPosition: Offset(23.9, 14.3) button: 1 sent tap down

======== Exception caught by widgets library ======================================================= The following assertion was thrown building: Remote uid can not be null or 0 'package:agora_rtc_engine/src/render/video_view_controller.dart': Failed assertion: line 81 pos 16: 'canvas.uid != null && canvas.uid != 0'

When the exception was thrown, this was the stack:

2 new VideoViewController.remote (package:agora_rtc_engine/src/render/video_view_controller.dart:81:16)

3 _FloatingLayoutState._getRemoteViews (package:agora_uikit/src/layout/floating_layout.dart:88:39)

4 _FloatingLayoutState._viewFloat. (package:agora_uikit/src/layout/floating_layout.dart:329:57)

5 SliverChildBuilderDelegate.build (package:flutter/src/widgets/scroll_delegate.dart:489:22)

6 SliverMultiBoxAdaptorElement._build (package:flutter/src/widgets/sliver.dart:828:28)

7 SliverMultiBoxAdaptorElement.performRebuild.processElement (package:flutter/src/widgets/sliver.dart:758:67)

8 Iterable.forEach (dart:core/iterable.dart:346:35)

9 SliverMultiBoxAdaptorElement.performRebuild (package:flutter/src/widgets/sliver.dart:805:24)

10 SliverMultiBoxAdaptorElement.update (package:flutter/src/widgets/sliver.dart:734:7)

11 Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)

12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)

13 Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)

14 ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)

15 Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)

16 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)

17 Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)

BulbulH commented 10 months ago

uses:

void initAgoraUikit() async { client = AgoraClient( agoraConnectionData: AgoraConnectionData( appId: appId, channelName:widget.channelName, uid: widget.uid, username: widget.username, tempToken: getTokenAgora() ),

    agoraChannelData: AgoraChannelData(
      clientRoleType: ClientRoleType.clientRoleBroadcaster,
    )

);

await client!.initialize();

}

Expanded( child: Stack( children: [ AgoraVideoViewer( client: client!, layoutType: Layout.floating, enableHostControls: widget.isHost, // Add this to enable host controls showAVState: true,

              ),
              AgoraVideoButtons(
                client: client!,
                autoHideButtons: true,
                autoHideButtonTime: 3,

                onDisconnect: (){
                  Get.back();
                },

                addScreenSharing: true, // Add this to enable screen sharing
              ),
            ],
          ),
        ),
Meherdeep commented 10 months ago

@BulbulH Can you please check if you're using the latest version of the UIKit. Also, it would be great if you could share steps to reproduce the error.

connlaoi commented 1 month ago

@Meherdeep @BulbulH @tadaspetra

Can confirm this is still occurring on agora_uikit: ^1.3.10

════════ Exception caught by widgets library ═══════════════════════════════════ Remote uid can not be null or 0 'package:agora_rtc_engine/src/render/video_view_controller.dart': Failed assertion: line 81 pos 16: 'canvas.uid != null && canvas.uid != 0' ══════════════════════════════════════════════════════════════════

Attempting to pin a user guarantees this error. However, it can also occur without any user interaction at all. This seems to be a common reoccurring issue for a long time now. I believe this should be escalated and prioritized as it is a critical error and makes the solution essentially obsolete.

There has also been minimal activity in this package/repo in a long time. If this package is deprecated, then it should be communicated to the user base so other solutions can be found/created and used instead.