Fazer upgrade para o plug-in do Gradle para Crashlytics v3
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
A versão mais recente do plug-in do Gradle para Crashlytics é uma das versões
principais do Google (v3.0.0) e moderniza o SDK eliminando o suporte a versões anteriores
do Gradle e do Plug-in do Android para Gradle. Além disso, as mudanças nesta
versão resolvem problemas com o AGP v8.1+ e melhoram o suporte a apps nativos e
builds personalizados.
Requisitos mínimos
O plug-in do Gradle para Crashlytics v3 tem os seguintes requisitos mínimos:
Plug-in do Android para Gradle 8.1+
Atualize o plug-in usando o
Assistente de upgrade do Plug-in do Android para Gradle
na versão mais recente do Android Studio.
Plug-in google-services
do Firebase para Gradle 4.4.1+
Faça upgrade do plug-in especificando a versão mais recente no arquivo de build do Gradle
do seu projeto desta forma:
Kotlin
plugins {
id("com.android.application") version "8.1.4" apply false
id("com.google.gms.google-services") version "4.4.3" apply false
...
}
Groovy
plugins {
id 'com.android.application' version '8.1.4' apply false
id 'com.google.gms.google-services' version '4.4.3' apply false
...
}
Mudanças na extensão do Crashlytics
Com a v3 do plug-in do Gradle para Crashlytics, a extensão do Crashlytics tem
estas alterações interruptivas:
A extensão foi removida do bloco do Android defaultConfig
. Em vez disso,
precisa configurar cada variante.
O campo descontinuado mappingFile
foi removido. Em vez disso, o arquivo de mapeamento mesclado
é fornecido automaticamente.
O campo descontinuado strippedNativeLibsDir
foi removido. Em vez disso, use
unstrippedNativeLibsDir
para todas as bibliotecas nativas.
O campo unstrippedNativeLibsDir
foi mudado para ser cumulativo.
Ver um exemplo com vários diretórios
buildTypes {
release {
configure<CrashlyticsExtension> {
nativeSymbolUploadEnabled = true
unstrippedNativeLibsDir = file("MY/NATIVE/LIBS")
}
}
productFlavors {
flavorDimensions += "feature"
create("basic") {
dimension = "feature"
// ...
}
create("featureX") {
dimension = "feature"
configure<CrashlyticsExtension> {
unstrippedNativeLibsDir = file("MY/FEATURE_X/LIBS")
}
}
}
}
A tarefa uploadCrashlyticsSymbolFilesBasicRelease
só vai fazer upload dos
símbolos em MY/NATIVE/LIBS
,
mas uploadCrashlyticsSymbolFilesFeatureXRelease
vai fazer upload dos símbolos
ambos MY/NATIVE/LIBS
e MY/FEATURE_X/LIBS
.
O campo de interdição symbolGenerator
foi substituído por dois novos campos de nível superior:
symbolGeneratorType
, uma string de "breakpad"
(padrão) ou
"csym"
:
breakpadBinary
, um arquivo de uma substituição binária local de dump_syms
.
Exemplo de como fazer upgrade da extensão
Kotlin
Antes |
buildTypes {
release {
configure<CrashlyticsExtension> {
// ...
symbolGenerator(
closureOf<SymbolGenerator> {
symbolGeneratorType = "breakpad"
breakpadBinary = file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
)
}
}
}
|
Agora na v3 |
buildTypes {
release {
configure<CrashlyticsExtension> {
// ...
symbolGeneratorType = "breakpad"
breakpadBinary = file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
|
Groovy
Antes |
buildTypes {
release {
firebaseCrashlytics {
// ...
symbolGenerator {
breakpad {
binary file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
}
}
|
Agora na v3 |
buildTypes {
release {
firebaseCrashlytics {
// ...
symbolGeneratorType "breakpad"
breakpadBinary file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
|
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-08-12 UTC.
[null,null,["Última atualização 2025-08-12 UTC."],[],[],null,["\u003cbr /\u003e\n\nThe latest release of the Crashlytics Gradle plugin is a major\nversion (v3.0.0) and modernizes the SDK by dropping support for lower versions\nof Gradle and the Android Gradle plugin. Additionally, the changes in this\nrelease resolve issues with AGP v8.1+ and improve support for native apps and\ncustomized builds.\n\nMinimum requirements\n\nCrashlytics Gradle plugin v3 has the following minimum requirements:\n\n- Android Gradle plugin 8.1+ \n\n Upgrade this plugin using the\n [Android Gradle plugin Upgrade Assistant](https://developer.android.com/build/agp-upgrade-assistant)\n on the latest version of Android Studio.\n\n- Firebase's `google-services` Gradle plugin 4.4.1+ \n\n Upgrade this plugin by specifying the latest version in your project's Gradle\n build file, like so:\n\nKotlin \n\n```kotlin\nplugins {\n id(\"com.android.application\") version \"8.1.4\" apply false\n id(\"com.google.gms.google-services\") version \"4.4.3\" apply false\n ...\n}\n```\n\nGroovy \n\n```groovy\nplugins {\n id 'com.android.application' version '8.1.4' apply false\n id 'com.google.gms.google-services' version '4.4.3' apply false\n ...\n}\n```\n\nChanges to the Crashlytics extension\n\nWith v3 of the Crashlytics Gradle plugin, the Crashlytics extension has\nthe following breaking changes:\n\n- Removed the extension from the `defaultConfig` android block. Instead, you\n should configure each variant.\n\n- Removed the deprecated field `mappingFile`. Instead, the merged mapping file\n is now provided automatically.\n\n- Removed the deprecated field `strippedNativeLibsDir`. Instead, you should use\n `unstrippedNativeLibsDir` for all native libs.\n\n- Changed the field `unstrippedNativeLibsDir` to be cumulative.\n\n View an example with multiple directories\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n ```kotlin\n buildTypes {\n release {\n configure\u003cCrashlyticsExtension\u003e {\n nativeSymbolUploadEnabled = true\n unstrippedNativeLibsDir = file(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eMY/NATIVE/LIBS\u003c/var\u003e\")\n }\n }\n productFlavors {\n flavorDimensions += \"feature\"\n create(\"basic\") {\n dimension = \"feature\"\n // ...\n }\n create(\"featureX\") {\n dimension = \"feature\"\n configure\u003cCrashlyticsExtension\u003e {\n unstrippedNativeLibsDir = file(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eMY/FEATURE_X/LIBS\u003c/var\u003e\")\n }\n }\n }\n }\n \n ```\n\n \u003cbr /\u003e\n\n The `uploadCrashlyticsSymbolFilesBasicRelease` task will only upload the\n symbols in \u003cvar class=\"readonly\" translate=\"no\"\u003eMY/NATIVE/LIBS\u003c/var\u003e,\n but `uploadCrashlyticsSymbolFilesFeatureXRelease` will upload symbols in\n both \u003cvar class=\"readonly\" translate=\"no\"\u003eMY/NATIVE/LIBS\u003c/var\u003e\n and \u003cvar class=\"readonly\" translate=\"no\"\u003eMY/FEATURE_X/LIBS\u003c/var\u003e.\n\n \u003cbr /\u003e\n\n- Replaced the closure field `symbolGenerator` with two new top level fields:\n\n - `symbolGeneratorType`, a String of either `\"breakpad\"` (default) or `\"csym\"`.\n - `breakpadBinary`, a File of a local `dump_syms` binary override.\n\nExample for how to upgrade the extension \n\nKotlin\n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Before** | ```kotlin buildTypes { release { configure\u003cCrashlyticsExtension\u003e { // ... symbolGenerator( closureOf\u003cSymbolGenerator\u003e { symbolGeneratorType = \"breakpad\" breakpadBinary = file(\"\u003cvar translate=\"no\"\u003e/PATH/TO/BREAKPAD/DUMP_SYMS\u003c/var\u003e\") } ) } } } ``` |\n| **Now in v3** | ```kotlin buildTypes { release { configure\u003cCrashlyticsExtension\u003e { // ... symbolGeneratorType = \"breakpad\" breakpadBinary = file(\"\u003cvar translate=\"no\"\u003e/PATH/TO/BREAKPAD/DUMP_SYMS\u003c/var\u003e\") } } } ``` |\n\nGroovy\n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Before** | ```groovy buildTypes { release { firebaseCrashlytics { // ... symbolGenerator { breakpad { binary file(\"\u003cvar translate=\"no\"\u003e/PATH/TO/BREAKPAD/DUMP_SYMS\u003c/var\u003e\") } } } } } ``` |\n| **Now in v3** | ```groovy buildTypes { release { firebaseCrashlytics { // ... symbolGeneratorType \"breakpad\" breakpadBinary file(\"\u003cvar translate=\"no\"\u003e/PATH/TO/BREAKPAD/DUMP_SYMS\u003c/var\u003e\") } } } ``` |"]]