Skip to content

Unhandled Exception: type 'Null' is not a subtype of type 'String' #39

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

Open
XuanTung95 opened this issue Apr 25, 2021 · 2 comments
Open

Comments

@XuanTung95
Copy link
Contributor

Your environment.

  • Version: ion-sdk-flutter v0.4.4, ion v1.9.0

What did you do?

  • Run ion-app-flutter

What happened?

Got this error after connected to room

I/flutter (30576): Get Message: {"receiver":{"receiverId":"f91130c6-6267-4936-a17d-85e769ab959b","rtpParameters":{"headerExtensions":[],"encodings":[],"codecs":[],"rtcp":{"cname":"","reducedSize":false},"transactionId":""},"track":{"kind":"audio","readyState":"LIVE","id":"f91130c6-6267-4936-a17d-85e769ab959b","label":"audio","enabled":true}},"sender":{"senderId":"6dd4c311-e253-401d-855a-2dc1dad942e4","rtpParameters":{"headerExtensions":[],"encodings":[],"codecs":[],"rtcp":{"cname":"","reducedSize":false},"transactionId":"fde3c233-2440-4572-a464-a9def316915c"},"ownsTrack":true,"track":{"kind":"audio","readyState":"LIVE","id":"6dd4c311-e253-401d-855a-2dc1dad942e4","label":"audio","enabled":true},"dtmfSender":{"duration":100,"dtmfSenderId":"6dd4c311-e253-401d-855a-2dc1dad942e4","interToneGap":50}},"mid":null,"transceiverId":null,"direction":"sendonly"}
E/flutter (30576): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
E/flutter (30576): #0      new RTCRtpTransceiverNative.fromMap (package:flutter_webrtc/src/native/rtc_rtp_transceiver_impl.dart:74:12)
E/flutter (30576): #1      RTCPeerConnectionNative.addTransceiver (package:flutter_webrtc/src/native/rtc_peerconnection_impl.dart:512:38)
E/flutter (30576): <asynchronous suspension>
E/flutter (30576): #2      LocalStream.publishTrack (package:flutter_ion/src/stream.dart:236:27)
E/flutter (30576): <asynchronous suspension>
E/flutter (30576): 
I/flutter (30576): Get Message: {"receiver":{"receiverId":"a1a646a8-6c89-48e0-baae-5138dc8c57f2","rtpParameters":{"headerExtensions":[],"encodings":[],"codecs":[],"rtcp":{"cname":"","reducedSize":false},"transactionId":""},"track":{"kind":"video","readyState":"LIVE","id":"a1a646a8-6c89-48e0-baae-5138dc8c57f2","label":"video","enabled":true}},"sender":{"senderId":"a4512cfe-12c4-4986-bf11-6b7ba02dd282","rtpParameters":{"headerExtensions":[],"encodings":[{"active":true,"maxBitrate":2500000,"numTemporalLayers":1,"scaleResolutionDownBy":1.0,"maxFramerate":30}],"codecs":[],"rtcp":{"cname":"","reducedSize":false},"transactionId":"3770804e-3a45-41a4-852e-0d1f5eab7a45"},"ownsTrack":true,"track":{"kind":"video","readyState":"LIVE","id":"a4512cfe-12c4-4986-bf11-6b7ba02dd282","label":"video","enabled":true},"dtmfSender":{"dtmfSenderId":"a4512cfe-12c4-4986-bf11-6b7ba02dd282"}},"mid":null,"transceiverId":null,"direction":"sendonly"}
E/flutter (30576): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
E/flutter (30576): #0      new RTCRtpTransceiverNative.fromMap (package:flutter_webrtc/src/native/rtc_rtp_transceiver_impl.dart:74:12)
E/flutter (30576): #1      RTCPeerConnectionNative.addTransceiver (package:flutter_webrtc/src/native/rtc_peerconnection_impl.dart:512:38)
E/flutter (30576): <asynchronous suspension>
E/flutter (30576): #2      LocalStream.publishTrack (package:flutter_ion/src/stream.dart:236:27)
E/flutter (30576): <asynchronous suspension>
E/flutter (30576): 

I think the problems might relate to this block of code:

  void join(String sid, String uid) async {
    try {
      transports[RoleSub]!.pc!.onTrack = (RTCTrackEvent ev) {
        var remote = makeRemote(ev.streams[0], transports[RoleSub]!);
        ontrack?.call(ev.track, remote);
      };

      var pc = transports[RolePub]!.pc;
      if (pc != null) {
        var offer = await pc.createOffer({});
        await pc.setLocalDescription(offer);
        print('Step 1');
        var answer = await signal.join(sid, uid, offer);
        print('Step 2');                                         <-------- This line is never called
        await pc.setRemoteDescription(answer);
        transports[RolePub]!.hasRemoteDescription = true;
        transports[RolePub]!.candidates.forEach((c) => pc.addCandidate(c));
        pc.onRenegotiationNeeded = () => onnegotiationneeded();
      }
    } catch (e) {
      print('join: e => ${e.toString()}');
    }
  }
@jazzyyoung
Copy link

i have got the same problem :(

@ChokWah
Copy link

ChokWah commented May 27, 2021

I have got the same problem....

And, stream.preferLayer!(ion.Layer.medium); can's show camera view is screen? how to show camera view is screen?

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