-
Notifications
You must be signed in to change notification settings - Fork 646
enabling nativeSymbolUploadEnabled for multi variant application #5572
-
androidComponents {
beforeVariants { variant ->
configure<CrashlyticsExtension> {
unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/$variant/out/lib"
nativeSymbolUploadEnabled = true
}
}
}
I'm trying to enable symbol file upload for crashlytics using above code, but getting this error org.gradle.api.UnknownDomainObjectException: Extension of type 'CrashlyticsExtension' does not exist.
I really appreciate if you could help me.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments 1 reply
-
Hi @MahdiHatami, are you importing the extension?
#2665 (comment) has an example of how to use the Crashlytics + Kotlin DSL
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @rlazo , Yes I'm importing the extension
Beta Was this translation helpful? Give feedback.
All reactions
-
Could you share the whole gradle file and error message? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @rlazo
here is the rough picture of my gradle file, the idea is I'm trying to enable crashlytics native file upload for specific buildVariant:
e.g: FlavorARelease, FlavorBDebug, FlavorCStaging
Thanks!
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension buildTypes { getByName("release") { // } getByName("staging") { matchingFallbacks += listOf("release", "debug") } getByName("debug") { versionNameSuffix = "-debug" applicationIdSuffix = ".debug" ext.set("enableCrashlytics", false) } } productFlavors { create("flavorA") { dimension = "client" } create("flavorB") { dimension = "client" } create("flavorC") { dimension = "client" } } androidComponents { beforeVariants { variant -> configure<CrashlyticsExtension> { unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/$variant/out/lib" nativeSymbolUploadEnabled = true } } }
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
The CrashlyticsExtension does not register itself in anything to do with beforeVariants. It is registered in buildTypes and productFlavors. If you have multiple dimensions in your productFlavors I believe it follows the order you define them in, but I am not totally sure. You might be able to get away with just putting it in the first one.
You can exclude the unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/$variant/out/lib" line because the plugin will get the variant's native libs directly from the appropriate Task in the AGP.
So instead, you can enable symbol uploading by putting this directly in each buildTypes and/or each productFlavors you want it in.
configure<CrashlyticsExtension> {
nativeSymbolUploadEnabled = true
}
Beta Was this translation helpful? Give feedback.