1、设置打包链接包的时候动态删除美颜so文件
2、设置debug包不上传Google uploadCrashlyticsMappingFile 任务需要访问 Firebase 服务器来上传符号文件(mapping file)
This commit is contained in:
parent
211a6bd2de
commit
336b433513
@ -4,10 +4,12 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.alibaba.arouter'
|
apply plugin: 'com.alibaba.arouter'
|
||||||
apply from: "../package_config.gradle"
|
apply from: "../package_config.gradle"
|
||||||
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "myname.pdlive.shayu"
|
namespace "myname.pdlive.shayu"
|
||||||
compileSdk rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@ -68,7 +70,7 @@ android {
|
|||||||
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
exclude 'lib/armeabi-v7a/libMNN_CL.so'
|
||||||
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
exclude 'lib/armeabi-v7a/libMNN_Express.so'
|
||||||
|
|
||||||
if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
/*if (rootProject.ext.manifestPlaceholders.isGooglePlay == 0) {
|
||||||
// 链接包剔除相心美颜SO
|
// 链接包剔除相心美颜SO
|
||||||
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
exclude 'lib/armeabi-v7a/libCNamaSDK.so'
|
||||||
exclude 'lib/armeabi-v7a/libfuai.so'
|
exclude 'lib/armeabi-v7a/libfuai.so'
|
||||||
@ -76,7 +78,7 @@ android {
|
|||||||
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
exclude 'lib/arm64-v8a/libCNamaSDK.so'
|
||||||
exclude 'lib/arm64-v8a/libfuai.so'
|
exclude 'lib/arm64-v8a/libfuai.so'
|
||||||
|
|
||||||
/* // 剔除声网X86架构的so
|
// 剔除声网X86架构的so
|
||||||
exclude 'lib/x86/libagora-core.so'
|
exclude 'lib/x86/libagora-core.so'
|
||||||
exclude 'lib/x86/libagora-ffmpeg.so'
|
exclude 'lib/x86/libagora-ffmpeg.so'
|
||||||
exclude 'lib/x86/libagora-fdkaac.so'
|
exclude 'lib/x86/libagora-fdkaac.so'
|
||||||
@ -99,7 +101,7 @@ android {
|
|||||||
exclude 'lib/x86/libagora_video_encoder_extension.so'
|
exclude 'lib/x86/libagora_video_encoder_extension.so'
|
||||||
exclude 'lib/x86/libagora_video_quality_analyzer_extension.so'
|
exclude 'lib/x86/libagora_video_quality_analyzer_extension.so'
|
||||||
exclude 'lib/x86/libagora_video_dec.so'
|
exclude 'lib/x86/libagora_video_dec.so'
|
||||||
exclude 'lib/x86/libagora_video_enc.so'*//*
|
exclude 'lib/x86/libagora_video_enc.so'/*
|
||||||
|
|
||||||
exclude 'lib/x86_64/libagora-core.so'
|
exclude 'lib/x86_64/libagora-core.so'
|
||||||
exclude 'lib/x86_64/libagora-ffmpeg.so'
|
exclude 'lib/x86_64/libagora-ffmpeg.so'
|
||||||
@ -107,7 +109,7 @@ android {
|
|||||||
exclude 'lib/x86_64/libagora-soundtouch.so'
|
exclude 'lib/x86_64/libagora-soundtouch.so'
|
||||||
exclude 'lib/x86_64/libagora-rtc-sdk.so'
|
exclude 'lib/x86_64/libagora-rtc-sdk.so'
|
||||||
|
|
||||||
*//* exclude 'lib/x86_64/libagora_clear_vision_extension.so'
|
/* exclude 'lib/x86_64/libagora_clear_vision_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_segmentation_extension.so'
|
exclude 'lib/x86_64/libagora_segmentation_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_screen_capture_extension.so'
|
exclude 'lib/x86_64/libagora_screen_capture_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_audio_beauty_extension.so'
|
exclude 'lib/x86_64/libagora_audio_beauty_extension.so'
|
||||||
@ -123,10 +125,13 @@ android {
|
|||||||
exclude 'lib/x86_64/libagora_ai_echo_cancellation_extension.so'
|
exclude 'lib/x86_64/libagora_ai_echo_cancellation_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_lip_sync_extension.so'
|
exclude 'lib/x86_64/libagora_lip_sync_extension.so'
|
||||||
exclude 'lib/x86_64/libagora_video_dec.so'
|
exclude 'lib/x86_64/libagora_video_dec.so'
|
||||||
exclude 'lib/x86_64/libagora_video_enc.so'*/
|
exclude 'lib/x86_64/libagora_video_enc.so'
|
||||||
|
|
||||||
|
*//*
|
||||||
|
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@ -138,6 +143,34 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
|
// 根据渠道配置删除美颜so文件
|
||||||
|
if (variant.flavorName == "link_test" || variant.flavorName == "link_online") {
|
||||||
|
println "variant.flavorName:${variant.flavorName}"
|
||||||
|
println "variant.name:${variant.name}"
|
||||||
|
|
||||||
|
// 这里使用 mergeNativeLibs 任务,它会在文件合并后执行
|
||||||
|
def taskName = "merge${variant.name.capitalize()}NativeLibs"
|
||||||
|
tasks.matching { it.name == taskName }.configureEach { task ->
|
||||||
|
task.doLast {
|
||||||
|
def soFiles = [
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/armeabi-v7a/libCNamaSDK.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/armeabi-v7a/libfuai.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/arm64-v8a/libCNamaSDK.so"),
|
||||||
|
file("${buildDir}/intermediates/merged_native_libs/${variant.name}/merge${variant.name.capitalize()}NativeLibs/out/lib/arm64-v8a/libfuai.so")
|
||||||
|
]
|
||||||
|
|
||||||
|
soFiles.each { soFile ->
|
||||||
|
if (soFile.exists()) {
|
||||||
|
soFile.delete()
|
||||||
|
println "Deleted ${soFile.name} for ${variant.flavorName}"
|
||||||
|
} else {
|
||||||
|
println "File not found: ${soFile.path}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
println "清空build文件夹";
|
println "清空build文件夹";
|
||||||
for (final def project in rootProject.getAllprojects()) {
|
for (final def project in rootProject.getAllprojects()) {
|
||||||
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
def name = variant.name.replace('Debug', '').replace('Release', '').toLowerCase()
|
||||||
@ -286,10 +319,6 @@ android {
|
|||||||
useNewCruncher = false
|
useNewCruncher = false
|
||||||
}
|
}
|
||||||
|
|
||||||
packagingOptions {//加上这写代码 为了mob兼容性androidx
|
|
||||||
// pickFirst 'META-INF/*'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// applicationId "myname.pdlive.shayu"
|
// applicationId "myname.pdlive.shayu"
|
||||||
@ -329,6 +358,9 @@ android {
|
|||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
firebaseCrashlytics{
|
||||||
|
mappingFileUploadEnabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
@ -336,6 +368,10 @@ android {
|
|||||||
zipAlignEnabled false
|
zipAlignEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
||||||
|
firebaseCrashlytics{
|
||||||
|
mappingFileUploadEnabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@ -344,7 +380,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
flatDir {
|
flatDir {
|
||||||
dirs 'libs', '../libs'
|
dirs 'libs', '../libs'
|
||||||
|
@ -24,7 +24,7 @@ ext {
|
|||||||
|
|
||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
|
|
||||||
// true表示谷歌支付 false 0 链接包(isPluginModel-> true) 1 谷歌包 2华为包 3 samsung包
|
// 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||||
isGooglePlay : 0,
|
isGooglePlay : 0,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
isUploadLog : true,
|
||||||
|
Loading…
Reference in New Issue
Block a user