Flutter jitsi meet 无法在发布的 apk 上工作。单击“连接”按钮时应用程序停止

问题描述 投票:0回答:1

**这是我的 Jitsi 代码 - ** 我们正在为 jitsi 使用 jitsi_meet_flutter_sdk 包

Flutter Jitsi Meet 应用程序中的 ProGuard 问题

问题陈述

我在集成了 Jitsi Meet SDK 的 Flutter 应用程序中遇到了 JITSI 问题。应用程序在运行时崩溃或显示意外行为,我怀疑这与 ProGuard 有关。

详情

  • Flutter 版本:[您的 Flutter 版本]
  • Jitsi Meet SDK 版本:[您的 Jitsi Meet SDK 版本]
  • 错误消息或日志:[包括任何相关的错误消息或日志]

我尝试过的事情

我已在我的

proguard-rules.pro
文件中添加了 Jitsi Meet SDK 的 ProGuard 规则。此外,我已在
minifyEnabled
文件中将
useProguard
true
设置为
build.gradle

class JitsiProvider extends ChangeNotifier {
  bool _isMeetingComplete = false;
  bool get isMeetingComplete => _isMeetingComplete;
  bool _hasUserJoined = false;
  bool get hasUserJoined => _hasUserJoined;
  late Timer _meetingTimer;
  void createMeeting({
    required String appointmentID,
    required String roomName,
    required String meetURL,
    required String meetDescription,
    required bool isAudioMuted,
    required bool isVideoMuted,
    String username = '',
    String email = '',
    String userProfile = '',
    bool preJoined = true,
    bool isVideo = true,
    bool isGroup = true,
  }) async {
    print("APP ID : $appointmentID");
    try {
      _hasUserJoined = true;
      notifyListeners();

      // Starting a timer for 15 minutes
      // Initialize the meeting timer with a null check
      _meetingTimer = Timer(
          Duration(
            minutes: 20,
          ), () {
        callAPIappointmentCompleted(appointmentID);
        endMeeting();
        JitsiMeet().hangUp();
      });
      Map<String, dynamic> featureFlag = {};
      featureFlag['welcomepage.enabled'] = false;
      featureFlag['prejoinpage.enabled'] = preJoined;
      featureFlag['add-people.enabled'] = isGroup;

      var options = JitsiMeetConferenceOptions(
        room: roomName,
        serverURL: meetURL,
        configOverrides: {
          "startWithAudioMuted": isAudioMuted,
          "startWithVideoMuted": isVideoMuted,
          "subject": meetDescription,
        },
        userInfo: JitsiMeetUserInfo(
          displayName: username,
          email: email,
          avatar: userProfile,
        ),
        featureFlags: {
          "unsaferoomwarning.enabled": false,
          "add-people.enabled": false, // Set it to false here
          'chat.enabled': true,
          'invite.enabled': false,
          'ios.recording.enabled': false,
          'recording.enabled': false,
          'kick-out.enabled': false,
        },
      );
      var eventListeners = JitsiMeetEventListener(
        conferenceTerminated: (url, error) {
          print("MEET TERMINATED");
          print(url);
          callAPIappointmentCompleted(appointmentID);
        },
        participantLeft: (participantId) {
          print("user has left");
          print(participantId);
          callAPIappointmentCompleted(appointmentID);
        },
      );
      await JitsiMeet().join(options, eventListeners);
    } catch (error) {
      print("error: $error");
    }
  }

  void onMeetingEnd() {
    // Call your function here
    callAPIappointmentCompleted("YOUR_APPOINTMENT_ID");
    // Print the log message
    print("Log out initiated");
  }

  void endMeeting() {
    _isMeetingComplete = true;
    notifyListeners();
    _meetingTimer.cancel();
    onMeetingEnd();
  }

  

}

我尝试添加这个 progaurd-rules.pro 文件 -

#=== Flutter Wrapper ===#
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }

#=== Jitsi ===#
# Source: https://github.com/jitsi/jitsi-meet/blob/master/android/app/proguard-rules.pro
# Check above link for changes if release builds are broken again

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# React Native

# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.proguard.annotations.DoNotStrip *;
    @com.facebook.common.internal.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
  void set*(***);
  *** get*();
}

-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }

-dontwarn com.facebook.react.**
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }

# okhttp

-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# okio

-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-keep class okio.** { *; }
-dontwarn okio.**

# WebRTC

-keep class org.webrtc.** { *; }
-dontwarn org.chromium.build.BuildHooksAndroid

# Jisti Meet SDK

-keep class org.jitsi.meet.** { *; }
-keep class org.jitsi.meet.sdk.** { *; }
-keep class org.jitsi.** { *; }
-keep interface org.jitsi.** { *; }

# We added the following when we switched minifyEnabled on. Probably because we
# ran the app and hit problems...

-keep class com.facebook.react.bridge.CatalystInstanceImpl { *; }
-keep class com.facebook.react.bridge.ExecutorToken { *; }
-keep class com.facebook.react.bridge.JavaScriptExecutor { *; }
-keep class com.facebook.react.bridge.ModuleRegistryHolder { *; }
-keep class com.facebook.react.bridge.ReadableType { *; }
-keep class com.facebook.react.bridge.queue.NativeRunnable { *; }
-keep class com.facebook.react.devsupport.** { *; }

-dontwarn com.facebook.react.devsupport.**
-dontwarn com.google.appengine.**
-dontwarn com.squareup.okhttp.**
-dontwarn javax.servlet.**

# ^^^ We added the above when we switched minifyEnabled on.

# Rule to avoid build errors related to SVGs.
-keep public class com.horcrux.svg.** {*;}

# Hermes
-keep class com.facebook.hermes.unicode.** { *; }
flutter flutter-dependencies jitsi jitsi-meet video-conferencing
1个回答
0
投票

您找到解决方案了吗?我的发布也有同样的问题...

© www.soinside.com 2019 - 2024. All rights reserved.