ZEGOCLOUD / zego_uikit_prebuilt_call_flutter

MIT License
16 stars 15 forks source link

Excessive App Size After Installing zego_uikit_prebuilt_call #62

Open decodevM opened 1 month ago

decodevM commented 1 month ago

Environment

Technology Version
Flutter version 3.24.1
Plugin version 4.15.4
Android version +24

Description

After integrating the zego_uikit_prebuilt_call package in my Flutter project, I noticed that the APK size is significantly large. The generated release APK is 182.2MB, which seems excessive for the functionality provided by this single package.

Expected behavior: The APK size should be smaller and more optimized, especially for a single package integration.

Current behavior: The release APK size is 182.2MB, which is much larger than expected.

Steps to reproduce

  1. Create a new Flutter project with latest flutter SDK version.
  2. Add the following dependency to pubspec.yaml:
    dependencies:
    zego_uikit_prebuilt_call: 4.15.4
  3. Make sure you add the following plugin configurations to your settings.gradle file:
      plugins {
          id "dev.flutter.flutter-plugin-loader" version "1.0.0"
          id "com.android.application" version "7.3.0" apply false
          id "org.jetbrains.kotlin.android" version "1.8.0" apply false
      }
  4. Update your gradle-wrapper.properties file to use the correct distribution URL for Gradle 7.4:
         distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
    add also this configuration of android. 
  5. Run the command to build the release APK: flutter build apk --release
  6. Observe the final APK size.

Images

Screenshot 2024-09-07 at 11 10 13
yoer commented 1 month ago

image

You can reduce the app size using this command

flutter build apk --split-per-abi
decodevM commented 1 month ago

After reducing the app size and generating different compatibility versions for my Flutter project, I encountered an issue with the cached_video_player package. The error prevents the build of the app.

cached_video_player: ^2.0.4

Screenshot 2024-09-09 at 08 49 29
yoer commented 1 month ago

We have never encountered this error. I googled it. Can you try the following steps to solve it?

  1. Open the android/app project
  2. Search the text androidx.core:core-ktx:+ in all solutions. In most cases this is found in build.gradle file.
  3. If you found this text in some dependency, change androidx.core:core-ktx:+ to androidx.core:core-ktx:1.6.0
  4. Sync and run again