8000 java.lang.UnsatisfiedLinkError: dlopen failed: library "liblkjingle_peerconnection_so.so" not found · Issue #1520 · flutter-webrtc/flutter-webrtc · GitHub
[go: up one dir, main page]

Skip to content
< 8000 turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class="">

java.lang.UnsatisfiedLinkError: dlopen failed: library "liblkjingle_peerconnection_so.so" not found #1520

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

Closed
Adityachavda opened this issue Feb 5, 2024 · 3 comments

Comments

@Adityachavda
Copy link

Describe the bug
Encountering a FATAL Error with the message "java.lang.UnsatisfiedLinkError: dlopen failed: library "liblkjingle_peerconnection_so.so" not found" when attempting to establish a Peer Connection.

Here I'm attaching the full error message with stack trace:


E/AndroidRuntime(13274): at org.webrtc.PeerConnectionFactory.initialize(PeerConnectionFactory.java:295)
E/AndroidRuntime(13274): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.initialize(MethodCallHandlerImpl.java:151)
E/AndroidRuntime(13274): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:282)
E/AndroidRuntime(13274): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/AndroidRuntime(13274): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/AndroidRuntime(13274): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/AndroidRuntime(13274): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime(13274): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(13274): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(13274): at android.os.Looper.loop(Looper.java:255)
E/AndroidRuntime(13274): at android.app.ActivityThread.main(ActivityThread.java:8212)
E/AndroidRuntime(13274): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13274): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
E/AndroidRuntime(13274): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
I/Process (13274): Sending signal. PID: 13274 SIG: 9
Lost connection to device.

Exited.


To Reproduce
Invoke the creation of a Peer Connection by calling the RTCPeerConnection as follows:
RTCPeerConnection pc = await createPeerConnection(configuration, offerSdpConstraints);

Expected behavior
The process should seamlessly execute all necessary steps, resulting in the successful establishment of a VideoCall connection.

Platform information

  • Flutter version: 3.16.0
  • Plugin version: flutter_webrtc: ^0.9.48
  • OS: Android
  • OS version: Android 11
@cloudwebrtc
Copy link
Member

yes, fixed in https://github.com/flutter-webrtc/flutter-webrtc/releases/tag/0.9.48%2Bhotfix.1,

You just need to delete pubspec.lock in your project and run flutter pub get again.

@Adityachavda
Copy link
Author
Adityachavda commented Feb 6, 2024

I have resolved the previous issue, but now I'm encountering a new error. Any assistance you can provide would be greatly appreciated:

E/rtc (30359): #
E/rtc (30359): # Fatal error in: ../../../../../../_source/android/webrtc/src/pc/peer_connection.cc, line 832
E/rtc (30359): # last system error: 0
E/rtc (30359): # Check failed: !IsUnifiedPlan()
E/rtc (30359): # AddStream is not available with Unified Plan SdpSemantics. Please use AddTrack instead.
F/libc (30359): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 30671 (signaling_threa), pid 30359 (cial.video2Call)
Process name is com.social.video2Call, not key_process


Build fingerprint: 'realme/RMX2001/RMX2001L1:11/RP1A.200720.011/1647528410731:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-02-06 14:51:43+0530
pid: 30359, tid: 30671, name: signaling_threa >>> com.social.video2Call <<<
uid: 11799
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
x0 0000000000000000 x1 00000000000077cf x2 0000000000000006 x3 0000007c3a0fd870
x4 0000007d52bed000 x5 0000007d52bed000 x6 0000007d52bed000 x7 0000000002de7be8
x8 00000000000000f0 x9 0000007d4df698d8 x10 ffffff80fffffbdf x11 0000000000000001
x12 0000007c3a0fc190 x13 00000000000000f4 x14 0000007c3a0fc240 x15 00006a7a1cec6a07
x16 0000007d4e02a7e0 x17 0000007d4e009950 x18 0000007aaf074000 x19 00000000000000ac
x20 0000000000007697 x21 00000000000000b2 x22 00000000000077cf x23 00000000ffffffff
x24 0000000000000001 x25 0000007c3a0fdcc0 x26 0000007c3a0fdff8 x27 00000000000fe000
x28 00000000000fc000 x29 0000007c3a0fd8f0
lr 0000007d4dfbc944 sp 0000007c3a0fd850 pc 0000007d4dfbc974 pst 0000000000001000
backtrace:
#00 pc 0000000000078974 /apex/com.android.runtime/lib64/bionic/libc.so (abort+180) (BuildId: 554cb674fad07588ff08040bb89924c9)
#1 pc 000000000041e56c /data/app/~~ynpbYkls2chIZf3CuHzAxQ==/com.social.video2Call-QHxgAOns-SZxZXI87jaYiQ==/lib/arm64/libjingle_peerconnection_so.so (BuildId: 2d40e84f8b55885d)
Lost connection to device.

Exited.

The method for accessing user media is invoked as follows:

_getUserMedia() async {
MediaStream stream =
await navigator.mediaDevices.getUserMedia(mediaConstraints);
setState(() {
_localVideoRenderer.srcObject = stream;
});
return stream;
}

This method is utilized in the following context:

_createPeerConnection(
{required DocumentReference<Object?> roomRef,
required bool isJoining}) async {
_localStream = await _getUserMedia();

RTCPeerConnection pc =
    await createPeerConnection(configuration, offerSdpConstraints);

pc.addStream(_localStream); // I presume that the error is triggered by this line of code.

pc.onIceCandidate = (iceCandidate) {
  var callerCandidatesCollection = roomRef.collection("callerCandidates");
  var calleeCandidateCollection = roomRef.collection("calleeCandidates");

  if (iceCandidate.candidate != null) {
    debugPrint(jsonEncode({
      'candidate': iceCandidate.candidate,
      'sdpMlineIndex': iceCandidate.sdpMLineIndex,
      'sdpMid': iceCandidate.sdpMid,
    }));
    if (isJoining) {
      calleeCandidateCollection.add(iceCandidate.toMap());
    } else {
      callerCandidatesCollection.add(iceCandidate.toMap());
    }
  }
};
pc.onIceConnectionState = (state) {
  debugPrint("OnIceConnection State:- $state");
};

pc.onAddStream = (stream) {
  debugPrint("on addStream: ${stream.id}");
  _remoteVideoRenderer.srcObject = stream;
};

return pc;

}


@Adityachavda
Copy link
Author
Adityachavda commented Feb 7, 2024

I have resolved the previous issue, but now I'm encountering a new error. Any assistance you can provide would be greatly appreciated:

E/rtc (30359): # E/rtc (30359): # Fatal error in: ../../../../../../_source/android/webrtc/src/pc/peer_connection.cc, line 832 E/rtc (30359): # last system error: 0 E/rtc (30359): # Check failed: !IsUnifiedPlan() E/rtc (30359): # AddStream is not available with Unified Plan SdpSemantics. Please use AddTrack instead. F/libc (30359): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 30671 (signaling_threa), pid 30359 (cial.video2Call) Process name is com.social.video2Call, not key_process

Build fingerprint: 'realme/RMX2001/RMX2001L1:11/RP1A.200720.011/1647528410731:user/release-keys' Revision: '0' ABI: 'arm64' Timestamp: 2024-02-06 14:51:43+0530 pid: 30359, tid: 30671, name: signaling_threa >>> com.social.video2Call <<< uid: 11799 signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- x0 0000000000000000 x1 00000000000077cf x2 0000000000000006 x3 0000007c3a0fd870 x4 0000007d52bed000 x5 0000007d52bed000 x6 0000007d52bed000 x7 0000000002de7be8 x8 00000000000000f0 x9 0000007d4df698d8 x10 ffffff80fffffbdf x11 0000000000000001 x12 0000007c3a0fc190 x13 00000000000000f4 x14 0000007c3a0fc240 x15 00006a7a1cec6a07 x16 0000007d4e02a7e0 x17 0000007d4e009950 x18 0000007aaf074000 x19 00000000000000ac x20 0000000000007697 x21 00000000000000b2 x22 00000000000077cf x23 00000000ffffffff x24 0000000000000001 x25 0000007c3a0fdcc0 x26 0000007c3a0fdff8 x27 00000000000fe000 x28 00000000000fc000 x29 0000007c3a0fd8f0 lr 0000007d4dfbc944 sp 0000007c3a0fd850 pc 0000007d4dfbc974 pst 0000000000001000 backtrace: #00 pc 0000000000078974 /apex/com.android.runtime/lib64/bionic/libc.so (abort+180) (BuildId: 554cb674fad07588ff08040bb89924c9) #1 pc 000000000041e56c /data/app/~~ynpbYkls2chIZf3CuHzAxQ==/com.social.video2Call-QHxgAOns-SZxZXI87jaYiQ==/lib/arm64/libjingle_peerconnection_so.so (BuildId: 2d40e84f8b55885d) Lost connection to device.

Exited.

The method for accessing user media is invoked as follows:

_getUserMedia() async { MediaStream stream = await navigator.mediaDevices.getUserMedia(mediaConstraints); setState(() { _localVideoRenderer.srcObject = stream; }); return stream; }

This method is utilized in the following context:

_createPeerConnection( {required DocumentReference<Object?> roomRef, required bool isJoining}) async { _localStream = await _getUserMedia();

RTCPeerConnection pc =
    await createPeerConnection(configuration, offerSdpConstraints);

pc.addStream(_localStream); // I presume that the error is triggered by this line of code.

pc.onIceCandidate = (iceCandidate) {
  var callerCandidatesCollection = roomRef.collection("callerCandidates");
  var calleeCandidateCollection = roomRef.collection("calleeCandidates");

  if (iceCandidate.candidate != null) {
    debugPrint(jsonEncode({
      'candidate': iceCandidate.candidate,
      'sdpMlineIndex': iceCandidate.sdpMLineIndex,
      'sdpMid': iceCandidate.sdpMid,
    }));
    if (isJoining) {
      calleeCandidateCollection.add(iceCandidate.toMap());
    } else {
      callerCandidatesCollection.add(iceCandidate.toMap());
    }
  }
};
pc.onIceConnectionState = (state) {
  debugPrint("OnIceConnection State:- $state");
};

pc.onAddStream = (stream) {
  debugPrint("on addStream: ${stream.id}");
  _remoteVideoRenderer.srcObject = stream;
};

return pc;

}

I've figured it out. Instead of adding the stream as a whole, you need to add each track individually. Although I'm not entirely sure why this issue is occurring, it seems like they're saying "AddStream is not available with Unified Plan SdpSemantics." Here's the solution:

Instead of:

pc.addStream(_localStream);

You should use:

if (_localStream.getAudioTracks().isNotEmpty) {
    pc.addTrack(_localStream.getAudioTracks()[0], _localStream);
}
if (_localStream.getVideoTracks().isNotEmpty) {
    pc.addTrack(_localStream.getVideoTracks()[0], _localStream);
}

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

2 participants
0