首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何减小APPRTC库的大小?

如何减小APPRTC库的大小?
EN

Stack Overflow用户
提问于 2018-10-04 14:27:22
回答 1查看 181关注 0票数 0

在我的应用程序中,我实现了APPRTC。在实现APPRTC之前,我的应用程序大小是6MB。在实现APPRTC之后,我的应用程序大小达到了16MB。我只使用一对一语音聊天。我们还能有其他选择来减小应用程序大小或webrtc库大小吗?请建议..谢谢..

注意:"libjingle_peerconnection_so.so“库的大小是10MB。

EN

回答 1

Stack Overflow用户

发布于 2018-10-04 14:32:08

你可以使用Gradle.拆分APK,比如

代码语言:javascript
复制
 // APK splitting
splits {
    abi {
        // Enable APK splitting wrt architecture
        enable true

        // Reset the architectures for which you need to build the APKs for
        reset()

        // Include the architectures for which Gradle is building APKs
        include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'

        // Set this to false if you don't want an APK that has native code for all architectures
        universalApk false
    }
}

// Assign codes to each architecture
project.ext.versionCodes = ['x86': 0, 'x86_64': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3]

// Add the architecture-specific codes above to base version code, i.e. the version code specified in the defaultConfig{} block
// Example: 2000 is the base version code -> 2000 (x86), 2001 (x86_64), 2002 (armeabi-v7a) & 2003 (arm64-v8a) would be the version codes for the generated APK files
android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.versionCodeOverride = project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1 + android.defaultConfig.versionCode
    }
}
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52640356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档