【问题标题】:How to disable uploading mapping file of Firebase Crashlytics for alpha and beta version?如何禁用上传 Firebase Crashlytics 的 alpha 和 beta 版本的映射文件?
【发布时间】:2020-09-18 07:24:36
【问题描述】:

我想禁用将映射文件上传到 Firebase 服务器以进行 alpha 和 beta 构建。

我的成绩构建类型:

buildTypes {
    release {
        minifyEnabled true
        debuggable false
        useProguard false
        zipAlignEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

    }
    beta {
        minifyEnabled true
        debuggable true
        zipAlignEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
    }
    alpha {
        minifyEnabled true
        debuggable true
        zipAlignEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        firebaseCrashlytics {
            mappingFileUploadEnabled false
        }
    }
}

但添加此代码后:

firebaseCrashlytics {
    mappingFileUploadEnabled false
}

我有这个错误,我不知道如何解决它:

No signature of method: build_1dvhq7u1hv066n9hrxkm7yggx.android() is applicable for argument types: (build_1dvhq7u1hv066n9hrxkm7yggx$_run_closure1) values: [build_1dvhq7u1hv066n9hrxkm7yggx$_run_closure1@48779342]

【问题讨论】:

    标签: android firebase gradle crashlytics


    【解决方案1】:

    我遇到了同样的问题。错误代码:

    debug{
      firebaseCrashlytics {
        mappingFileUploadEnabled = false
      }
    }
    apply plugin: 'com.google.firebase.crashlytics'
    

    正确的代码:

    apply plugin: 'com.google.firebase.crashlytics'
    android{
          debug{
            firebaseCrashlytics {
              mappingFileUploadEnabled = false
            }
         }
    }
    

    原因是插件的声明放在了使用的后面,希望对你有帮助。

    【讨论】:

    • 这应该是被接受的答案。你为我节省了几个小时。
    猜你喜欢
    • 2018-04-27
    • 2021-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-01
    • 1970-01-01
    • 2018-08-23
    相关资源
    最近更新 更多