Skip to content

Commit ad1ec28

Browse files
authored
Merge pull request #678 from SimonMarquis/patch-2
Don't rely on `finalizeDsl` API to configure Crashlytics
2 parents b3cdc17 + 80b8ae7 commit ad1ec28

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
17+
import com.android.build.api.dsl.ApplicationExtension
1818
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
1919
import org.gradle.api.Plugin
2020
import org.gradle.api.Project
@@ -41,15 +41,13 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin<Project> {
4141
"implementation"(libs.findLibrary("firebase.crashlytics").get())
4242
}
4343

44-
extensions.configure<ApplicationAndroidComponentsExtension> {
45-
finalizeDsl {
46-
it.buildTypes.forEach { buildType ->
47-
// Disable the Crashlytics mapping file upload. This feature should only be
48-
// enabled if a Firebase backend is available and configured in
49-
// google-services.json.
50-
buildType.configure<CrashlyticsExtension> {
51-
mappingFileUploadEnabled = false
52-
}
44+
extensions.configure<ApplicationExtension> {
45+
buildTypes.configureEach {
46+
// Disable the Crashlytics mapping file upload. This feature should only be
47+
// enabled if a Firebase backend is available and configured in
48+
// google-services.json.
49+
configure<CrashlyticsExtension> {
50+
mappingFileUploadEnabled = false
5351
}
5452
}
5553
}

0 commit comments

Comments
 (0)