Skip to content Skip to sidebar Skip to footer

Apk Incresed In Size After Adding Ffmpegmediametadataretriever

I added the dependency (com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.3) to my application ( build.gradle ) in my Android Studio, The apk jumped from 2 MB to 16 MB .I just

Solution 1:

FFmpegMediaMetadataRetriever uses native code. This means the library includes prebuilt binaries for each support Android architecture. If you'd like to reduce your APK size you'll need to use the prebuilt libraries found on the FFmpegMediaMetadataRetriever project page and build an APK each supported architecture manually.

Solution 2:

The only way to decrease Apk size after including FFmpegMediaMetadataRetriever is the support ABI spits.

FFmpegMediaMetadataRetriever uses native code that is different for every CPU used. If you don't slit, all native codes will be merged inside your APK: a total of 25Mb or more!

So by adding these lines to your build.gradle, you will enable APK splitting:

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    splits {

        // Configures multiple APKs based on ABI.
        abi {

            // Enables building multiple APKs per ABI.
            enable true// By default all ABIs are included, so use reset() and include to specify that we only// want APKs for x86, armeabi-v7a, and mips.// Resets the list of ABIs that Gradle should create APKs for to none.
            reset()

            // Specifies a list of ABIs that Gradle should create APKs for.include"x86", "armeabi-v7a", "mips", "arm64-v8a", "x86_64", "armeabi"// Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk true
        }
    }

So, after apk build (or generate signed APK), your build would have 6 apks, one for each cpu. Upload them all to google play so your user would only download the necessary files. A armeabi-v7a APK will only be around 6Mb!

Post a Comment for "Apk Incresed In Size After Adding Ffmpegmediametadataretriever"