在我的应用程序中,我实现了APPRTC。在实施 APPRTC 之前,我的应用程序大小为 6MB。实施 APPRTC 后,我的应用程序大小变为 16 MB。我只使用一对一的语音聊天。我们可以有其他选项来减小APP大小或webrtc库大小吗?请建议.. 谢谢。。
注意:"libjingle_peerconnection_so.so"自由大小为 10 MB。
您可以使用Gradle.
喜欢来拆分APK,
// 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
}
}
}