gunschu / jitsi_meet

Initial commit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: < JitsiMeetingListener - onOpened But but Activity Crashed on Release Mode>

SyedHuzaifaAli-1998 opened this issue · comments

jitsi_meet plugin version
omni_jitsi_meet: ^1.0.13

Right now I need to send it to production over google play store but in debug mode, it is performing ok, but not in release mode

I resolved the Icon Error by changing the ic_notification icon

I am unable to find any solution and unable to see what is going wrong since it is in release mode
I tried to run it on Samsung A02s, Google Pixel 4, Google Pixel 5, Mark 1 10, Android api level 10, 11, 12
The result is the same whenever I try to open it with a button press it crashed without any debug response
The last response it shows is

[ +133 ms] I/flutter (20586): JitsiMeetingListener - onOpened

proguard-android.txt

Describe the bug
JitsiMeetingListener - onOpened but afterwards, there is no screen and app closed

Flutter doctor -v
flutter doctor -v
[√] Flutter (Channel stable, 3.7.5, on Microsoft Windows [Version 10.0.19045.2846], locale en-US)
• Flutter version 3.7.5 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c07f788888 (3 months ago), 2023-02-22 17:52:33 -0600
• Engine revision 0f359063c4
• Dart version 2.19.2
• DevTools version 2.20.1

This is taking an unexpectedly long time...[√] Windows Version (Installed version of Windows is version 10 or higher)

Checking Android licenses is taking an unexpectedly long time...[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at C:\Users\Huzaifa\AppData\Local\Android\sdk
• Platform android-33-ext5, build-tools 33.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33403.182
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these
components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK

[√] Android Studio (version 2022.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] VS Code, 64-bit edition (version 1.77.3)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.62.0

[√] Connected device (4 available)
• SM A025F (mobile) • R9HR604QBGL • android-arm • Android 12 (API 31)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.2846]
• Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.93
• Edge (web) • edge • web-javascript • Microsoft Edge 113.0.1774.42

[√] HTTP Host Availability
• All required HTTP hosts are available

! Doctor found issues in 2 categories.

Additional context this is proguard File
-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.
* { *; }

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
proguard-android.txt

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 ; }
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }

-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

Jitsi Meet SDK

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

Jitsi Meet dependencies

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

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

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

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

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

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

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

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

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

-keep class org.webrtc.** { *; }

-keep class com.facebook.react.** { *; }

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.** { *; }

facebook/fresco#2638
-keep public class com.facebook.imageutils.** {
public *;
}

JitsiMeet Code That I used

_joinMeeting() async {
// final String? serverUrl =
// serverText.text.trim().isEmpty ? null : serverText.text;

final featureFlags = {
  /*FeatureFlagEnum.ADD_PEOPLE_ENABLED: false,
  FeatureFlagEnum.ANDROID_SCREENSHARING_ENABLED: false,
  FeatureFlagEnum.AUDIO_FOCUS_DISABLED: false,
  FeatureFlagEnum.AUDIO_MUTE_BUTTON_ENABLED: true,
  FeatureFlagEnum.AUDIO_ONLY_BUTTON_ENABLED: false,
  FeatureFlagEnum.CALENDAR_ENABLED: false,
  FeatureFlagEnum.CAR_MODE_ENABLED: false,
  FeatureFlagEnum.CLOSE_CAPTIONS_ENABLED: false,
  FeatureFlagEnum.CONFERENCE_TIMER_ENABLED: false,
  FeatureFlagEnum.CHAT_ENABLED: false,
  FeatureFlagEnum.FILMSTRIP_ENABLED: false,
  FeatureFlagEnum.FULLSCREEN_ENABLED: true,
  FeatureFlagEnum.HELP_BUTTON_ENABLED: false,
  FeatureFlagEnum.INVITE_ENABLED: false,
  FeatureFlagEnum.IOS_RECORDING_ENABLED: false,
  FeatureFlagEnum.IOS_SCREENSHARING_ENABLED: false,
  FeatureFlagEnum.SPEAKERSTATS_ENABLED: false,
  FeatureFlagEnum.KICK_OUT_ENABLED: false,
  FeatureFlagEnum.LIVE_STREAMING_ENABLED: false,
  FeatureFlagEnum.LOBBY_MODE_ENABLED: false,
  FeatureFlagEnum.MEETING_NAME_ENABLED: false,
  FeatureFlagEnum.MEETING_PASSWORD_ENABLED: false,
  FeatureFlagEnum.NOTIFICATIONS_ENABLED: false,
  FeatureFlagEnum.OVERFLOW_MENU_ENABLED: true,
  FeatureFlagEnum.PIP_ENABLED: false,
  FeatureFlagEnum.PREJOIN_PAGE_ENABLED: false,
  FeatureFlagEnum.RAISE_HAND_ENABLED: false,
  FeatureFlagEnum.REACTIONS_ENABLED: false,
  FeatureFlagEnum.RECORDING_ENABLED: false,
  FeatureFlagEnum.REPLACE_PARTICIPANT: false,*/
  FeatureFlagEnum.RESOLUTION: FeatureFlagVideoResolution.MD_RESOLUTION,
  /*FeatureFlagEnum.SECURITY_OPTIONS_ENABLED: false,
  FeatureFlagEnum.SERVER_URL_CHANGE_ENABLED: false,
  FeatureFlagEnum.SETTINGS_ENABLED: false,
  FeatureFlagEnum.TILE_VIEW_ENABLED: true,
  FeatureFlagEnum.TOOLBOX_ALWAYS_VISIBLE: false,
  FeatureFlagEnum.TOOLBOX_ENABLED: true,
  FeatureFlagEnum.VIDEO_MUTE_BUTTON_ENABLED: true,
  FeatureFlagEnum.VIDEO_SHARE_BUTTON_ENABLED: false,*/
  FeatureFlagEnum.RECORDING_ENABLED: true,
  FeatureFlagEnum.WELCOME_PAGE_ENABLED: false,
  FeatureFlagEnum.SETTINGS_ENABLED:false,
};
if (Platform.isAndroid) {
  featureFlags[FeatureFlagEnum.CALL_INTEGRATION_ENABLED] = false;
}
// Define meetings options here
final options = JitsiMeetingOptions(
    room: "HuziRoom",
    // serverURL: serverUrl,
    // subject: subjectText.text,
    // userDisplayName: nameText.text,
    // userEmail: emailText.text,
    // iosAppBarRGBAColor: iosAppBarRGBAColor.text,
    // audioOnly: isAudioOnly,
    // audioMuted: isAudioMuted,
    // videoMuted: isVideoMuted,
    featureFlags: featureFlags,
    webOptions: {
      "roomName": "HuziRoom",
      "width": "100%",
      "height": "100%",
      "enableSetting":false,
      "enableWelcomePage": false,
      "enableNoAudioDetection": true,
      "enableNoisyMicDetection": true,
      "enableClosePage": false,
      "prejoinPageEnabled": false,
      "hideConferenceTimer": true,
      "disableInviteFunctions": true,
      "chromeExtensionBanner": null,
      "configOverwrite": {
        "prejoinPageEnabled": false,
        "disableDeepLinking": true,
        "enableLobbyChat": false,
        "enableClosePage": false,
        "chromeExtensionBanner": null,
        /*"toolbarButtons": [
          "microphone",
          "camera",
          "hangup",
        ]*/
      },
      "userInfo": {"email": "huzi@email.com", "displayName": "HuziHuzi"}
    });

await JitsiMeet.joinMeeting(
  options,
  listener: JitsiMeetingListener(
      onOpened: () {
        debugPrint("JitsiMeetingListener - onOpened");
      },
      onClosed: () {
        debugPrint("JitsiMeetingListener - onClosed");
      },
      onError: (error) {
        debugPrint("JitsiMeetingListener - onError: error: $error");
      },
      onConferenceWillJoin: (url) {
        debugPrint(
            "JitsiMeetingListener - onConferenceWillJoin: url: $url");
      },
      onConferenceJoined: (url) {
        debugPrint("JitsiMeetingListener - onConferenceJoined: url:$url");
      },
      onConferenceTerminated: (url, error) {
        debugPrint(
            "JitsiMeetingListener - onConferenceTerminated: url: $url, error: $error");
      },
      onParticipantLeft: (participantId) {
        debugPrint(
            "JitsiMeetingListener - onParticipantLeft: $participantId");
      },
      onParticipantJoined: (email, name, role, participantId) {
        debugPrint("JitsiMeetingListener - onParticipantJoined: "
            "email: $email, name: $name, role: $role, "
            "participantId: $participantId");
      },
      onAudioMutedChanged: (muted) {
        debugPrint(
            "JitsiMeetingListener - onAudioMutedChanged: muted: $muted");
      },
      onVideoMutedChanged: (muted) {
        debugPrint(
            "JitsiMeetingListener - onVideoMutedChanged: muted: $muted");
      },
      onScreenShareToggled: (participantId, isSharing) {
        debugPrint("JitsiMeetingListener - onScreenShareToggled: "
            "participantId: $participantId, isSharing: $isSharing");
      },
      genericListeners: [
        JitsiGenericListener(
            eventName: 'readyToClose',
            callback: (dynamic message) {
              debugPrint("JitsiMeetingListener - readyToClose callback");
            }),
      ]),
);

}

This is the app level gradle

buildTypes {
      release {
          // TODO: Add your own signing config for the release build.
          // Signing with the debug keys for now, so `flutter run --release` works.
          signingConfig signingConfigs.debug

//            runProguard false

          minifyEnabled true
//            useProguard true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }

This is project level gradle

buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        maven { url 'https://www.jitpack.io' }
        maven {
            url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
        }
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Error Logs
[ +133 ms] I/flutter (20586): JitsiMeetingListener - onOpened
after this in release mode, there is nothing app crashed but the terminal is still connected and showing nothing in the terminal,

This is much similar to other Bug Reports But it is a Flutter project not a react native or Android project
issue #284 App crash in release mode https://github.com/skrafft/react-native-jitsi-meet/issues/284
issue #6910 Jitsi meet black screen and crash in release build https://github.com/jitsi/jitsi-meet/issues/6910

At the End of many solutions, I can just find duplicate
The problem is the same
but dependencies are different

I've attached the ProGuard File of the configuration but still no use
There is no use of React native in the code but I added the react-native part as well in the ProGuard file

This is the AndroidManifest File is this creating the problem as I think so since the activity lifecycle on debug print not showing any thing

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.abc.abc">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.Manifest.permission.RECORD_AUDIO"/>
    <uses-sdk tools:overrideLibrary="dev.saibotma.jitsi_meet_wrapper, org.jitsi.meet.sdk, co.apptailor.googlesignin, com.calendarevents, com.reactnativecommunity.asyncstorage, com.reactnativecommunity.netinfo, com.rnimmersive, com.corbt.keepawake, com.BV.LinearGradient, com.horcrux.svg, com.oney.WebRTCModule, com.ocetnik.timer, com.kevinresol.react_native_default_preference, com.learnium.RNDeviceInfo, com.amplitude.reactnative, com.reactnativegooglesignin, com.reactnativecommunity.clipboard, com.swmansion.gesturehandler.react, org.linusu, org.reactnative.maskedview, com.reactnativepagerview, com.oblador.performance, com.swmansion.reanimated, com.th3rdwave.safeareacontext, com.swmansion.rnscreens, com.reactnativecommunity.slider, org.devio.rn.splashscreen, com.brentvatne.react, com.reactnativecommunity.webview"/>




    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
    </queries>


    <application
        android:label="abc"
        android:name="${applicationName}"
        android:screenOrientation="portrait"
        android:icon="@mipmap/ic_launcher"
        tools:replace="android:label"
        tools:node="merge"
        >

<!--        <service android:name="org.jitsi.meet.sdk.ConnectionService"-->
<!--            android:exported="true"-->
<!--            tools:ignore="MissingClass">-->
<!--            <intent-filter>-->
<!--                <action android:name="org.jitsi.meet.CONNECTION_SERVICE" />-->
<!--            </intent-filter>-->
<!--        </service>-->
<!--        <activity-->
<!--            android:name=".JitsiMeetPluginActivity"-->
<!--            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"-->
<!--            android:launchMode="singleTask"-->
<!--            android:resizeableActivity="true"-->
<!--            android:supportsPictureInPicture="true"-->
<!--            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"-->
<!--            android:windowSoftInputMode="adjustResize">-->
<!--        </activity>-->
<!--        <service android:name="org.jitsi.meet.sdk.ConnectionService"-->
<!--            android:exported="true"/>-->

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize"
            android:resizeableActivity="true"
            android:supportsPictureInPicture="true">
        <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme"
                />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="fullSensor"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"
            tools:ignore="MissingClass" />
        <activity android:name="com.android.camera.CropImage"
            tools:ignore="MissingClass" />

<!--        <service-->
<!--            android:name="org.jitsi.meet.sdk.ConnectionService"-->
<!--            android:exported="true">-->
<!--            &lt;!&ndash; Add any necessary intent filters for the service &ndash;&gt;-->
<!--        </service>-->
        <meta-data
            android:name="com.gunschu.jitsi_meet_example"
            android:resource="@mipmap/ic_launcher" />
<!--        <meta-data-->
<!--            android:name="com.abc.abc"-->
<!--            android:resource="@drawable/ic_notification" />-->
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.