How to disable uploading mapping file of Firebase Crashlytics for alpha and beta version?

Viewed 1353

I want to disable the uploading mapping file to the Firebase server for alpha and beta build.

My grade buildTypes:

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
        }
    }
}

But after adding this code:

firebaseCrashlytics {
    mappingFileUploadEnabled false
}

I have this error and I don't know how to fix it:

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

I had the same problem. error code:

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

right code:

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

The reason is that the declaration of the plugin is placed after the use of the,I I hope this helps.

Related