优化打包, 使用 splits abi 对每种CPU架构打独立的apk; 腾讯TRTC SDK优化集成方式, 并优化参数
This commit is contained in:
@@ -21,20 +21,20 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
// 设置支持的SO库架构
|
||||
if (onlyArm64) {
|
||||
abiFilters "arm64-v8a"
|
||||
} else {
|
||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions 'default'
|
||||
|
||||
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: CRASHLYTICS_COLLECTION_ENABLED.toBoolean()]
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
|
||||
bundle {
|
||||
language {
|
||||
enableSplit = false
|
||||
@@ -48,12 +48,21 @@ android {
|
||||
}
|
||||
|
||||
//在apk文件后边生成版本号信息
|
||||
android.applicationVariants.all {
|
||||
variant ->
|
||||
variant.outputs.all {
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
outputFileName = "piko_${buildType.name}_v${defaultConfig.versionName}-${date}.apk"
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
|
||||
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
|
||||
return
|
||||
}
|
||||
|
||||
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
if (abi == null) {
|
||||
abi = "universal"
|
||||
}
|
||||
outputFileName = "piko_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
|
@@ -102,8 +102,8 @@ dependencies {
|
||||
|
||||
api project(':nim_uikit')
|
||||
api project(':library')
|
||||
api project(':trtc_release')
|
||||
|
||||
implementation 'com.tencent.liteav:LiteAVSDK_TRTC:11.4.0.13189'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@@ -917,8 +917,7 @@ public class TRTCEngineAdapter extends BaseAdapterImpl {
|
||||
if (role == CLIENT_ROLE_BROADCASTER) {
|
||||
userRole = TRTCRoleAnchor;
|
||||
if (!TRtcEngineManager.get().isMute) {
|
||||
trtcCloud.getDeviceManager().setSystemVolumeType(TXDeviceManager.TXSystemVolumeType.TXSystemVolumeTypeMedia);
|
||||
trtcCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_DEFAULT);
|
||||
trtcCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_MUSIC);
|
||||
}
|
||||
} else if (role == CLIENT_ROLE_AUDIENCE) {
|
||||
userRole = TRTCRoleAudience;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
include ':app'
|
||||
include ':android_crop_lib'
|
||||
include ':trtc_release'
|
||||
include ':core'
|
||||
include ':library'
|
||||
include ':nim_uikit'
|
||||
|
3
trtc_release/.gitignore
vendored
3
trtc_release/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
/build
|
||||
*.iml
|
||||
*.DS_Store
|
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('LiteAVSDK_TRTC_11.4.0.13189.aar'))
|
Reference in New Issue
Block a user