Skip to content
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

Agora SDK is really huge #360

Closed
sils opened this issue Jun 30, 2021 · 10 comments
Closed

Agora SDK is really huge #360

sils opened this issue Jun 30, 2021 · 10 comments

Comments

@sils
Copy link

sils commented Jun 30, 2021

Is your feature request related to a problem? Please describe.
Upon reproducing another issue, I noticed that a flutter build without agora is about 16 MB, after adding agora I get about 53 MB. (See #359 , the reproduction instructions from there (without the firebase complexity) can also be used: https://gist.github.com/sils/fc3aba6242d5a7a9091b3cd766b3db7b)

Users nowadays don't appreciate getting such big binaries. If it'd double my app size I'd be slightly annoyed but at 4-5x the original amount this is a real argument against agora as a business decision.

Describe the solution you'd like
I surely don't need 40mb just to do a voice call? Maybe this can be split up.

Describe alternatives you've considered
Switching to twilio or others ;)

Additional context
Nope, should be pretty clear.

@marcusvpais
Copy link

Yes, i think this is a huge problem too. This happens i think because Video features and audio are together on flutter. Hopefully soon they'll separate that.

@LichKing-2234
Copy link
Contributor

you can use abifilter to remove some arches such as x86.

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Jul 1, 2021

and you can delete the .so file which named 'libagora_xxx_extension.so' if you not need it.

@sils
Copy link
Author

sils commented Jul 8, 2021

Thanks for the support. It seems at least for android, that google does some post release optimization and my download size on the device is indeed at mere 23mb now. Also there is another issue #340 so this is sort of a duplicate. Closing this to keep your tracker clean.

@sils sils closed this as completed Jul 8, 2021
@sepehr13494
Copy link

and you can delete the .so file which named 'libagora_xxx_extension.so' if you not need it.

how can we remove these files?

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Oct 7, 2021

add to app/build.gradle like this

packagingOptions { exclude 'lib/arm64-v8a/libmediaplayer.so' }

@sepehr13494
Copy link

sepehr13494 commented Oct 9, 2021

add to app/build.gradle like this

packagingOptions { exclude 'lib/arm64-v8a/libmediaplayer.so' }

I added these lines to my gradle but my app goes from 40.6 to 40

`
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 30

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
        exclude 'lib/arm64-v8a/libagora_dav1d_extensiokn.so'
        exclude 'lib/arm64-v8a/libagora_segmentation_extension.so'
        exclude 'lib/arm64-v8a/libagora_fd_extension.so'
        exclude 'lib/armeabi-v7a/libagora_dav1d_extension.so'
        exclude 'lib/armeabi-v7a/libagora_segmentation_extension.so'
        exclude 'lib/armeabi-v7a/libagora_fd_extension.so'
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.webnegah.pay_to_talk"
    minSdkVersion 21
    targetSdkVersion 30
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

signingConfigs {
    release {
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
        storePassword keystoreProperties['storePassword']
    }
}

buildTypes {
    release {
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a"
        }
        signingConfig signingConfigs.release

        minifyEnabled false

        // Enables resource shrinking, which is performed by the
        // Android Gradle plugin.
        shrinkResources false
        useProguard true

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.4.1')
implementation 'com.google.firebase:firebase-analytics'
}

`

@LichKing-2234
Copy link
Contributor

you can enable minifyEnabled and shrinkResources

@RasyidMF
Copy link

#340 Checkout my comment for relative solution

@github-actions
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants