อัปเกรดเป็นปลั๊กอิน Crashlytics Gradle v3
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Crashlyticsปลั๊กอิน Gradle เวอร์ชันล่าสุดเป็นเวอร์ชันหลัก (v3.0.0) และปรับปรุง SDK ให้ทันสมัยด้วยการเลิกสนับสนุน Gradle และปลั๊กอิน Android Gradle เวอร์ชันที่ต่ำกว่า
นอกจากนี้ การเปลี่ยนแปลงในรุ่นนี้ยังช่วยแก้ปัญหาเกี่ยวกับ AGP v8.1 ขึ้นไป และปรับปรุงการรองรับแอปเนทีฟและบิลด์ที่กำหนดเอง
ข้อกำหนดขั้นต่ำ
Crashlytics ปลั๊กอิน Gradle v3 มีข้อกำหนดขั้นต่ำดังนี้
ปลั๊กอิน Android Gradle 8.1 ขึ้นไป
อัปเกรดปลั๊กอินนี้โดยใช้
Android Gradle plugin Upgrade Assistant
ใน Android Studio เวอร์ชันล่าสุด
google-services
ปลั๊กอิน Gradle 4.4.1 ขึ้นไป
ของ Firebase
อัปเกรดปลั๊กอินนี้โดยระบุเวอร์ชันล่าสุดในไฟล์บิลด์ Gradle ของโปรเจ็กต์ ดังนี้
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
...
}
การเปลี่ยนแปลงส่วนขยาย Crashlytics
ปลั๊กอิน Crashlytics Gradle เวอร์ชัน 3 มีการเปลี่ยนแปลงที่ส่งผลกับส่วนอื่นในระบบต่อไปนี้สำหรับส่วนขยาย Crashlytics
นำส่วนขยายออกจากบล็อก defaultConfig
Android แล้ว แต่คุณ
ควรกำหนดค่าแต่ละรูปแบบ
นำฟิลด์ mappingFile
ที่เลิกใช้งานแล้วออก แต่ตอนนี้ระบบจะให้ไฟล์แมปที่ผสานรวมแล้วโดยอัตโนมัติแทน
นำฟิลด์ strippedNativeLibsDir
ที่เลิกใช้งานแล้วออก แต่คุณควรใช้ unstrippedNativeLibsDir
สำหรับไลบรารีเนทีฟทั้งหมดแทน
เปลี่ยนฟิลด์ unstrippedNativeLibsDir
ให้เป็นแบบสะสม
ดูตัวอย่างที่มีหลายไดเรกทอรี
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")
}
}
}
}
uploadCrashlyticsSymbolFilesBasicRelease
จะอัปโหลดเฉพาะสัญลักษณ์ใน MY/NATIVE/LIBS
แต่ uploadCrashlyticsSymbolFilesFeatureXRelease
จะอัปโหลดสัญลักษณ์ใน
ทั้ง MY/NATIVE/LIBS
และ MY/FEATURE_X/LIBS
แทนที่ฟิลด์การปิด symbolGenerator
ด้วยฟิลด์ระดับบนสุดใหม่ 2 รายการ ดังนี้
symbolGeneratorType
สตริงของ "breakpad"
(ค่าเริ่มต้น) หรือ
"csym"
breakpadBinary
ซึ่งเป็นไฟล์ของไบนารี dump_syms
ที่ลบล้างในเครื่อง
ตัวอย่างวิธีอัปเกรดส่วนขยาย
Kotlin
ก่อน |
buildTypes {
release {
configure<CrashlyticsExtension> {
// ...
symbolGenerator(
closureOf<SymbolGenerator> {
symbolGeneratorType = "breakpad"
breakpadBinary = file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
)
}
}
}
|
ตอนนี้ใน v3 |
buildTypes {
release {
configure<CrashlyticsExtension> {
// ...
symbolGeneratorType = "breakpad"
breakpadBinary = file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
|
Groovy
ก่อน |
buildTypes {
release {
firebaseCrashlytics {
// ...
symbolGenerator {
breakpad {
binary file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
}
}
|
ตอนนี้ใน v3 |
buildTypes {
release {
firebaseCrashlytics {
// ...
symbolGeneratorType "breakpad"
breakpadBinary file("/PATH/TO/BREAKPAD/DUMP_SYMS")
}
}
}
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-08 UTC
[null,null,["อัปเดตล่าสุด 2025-08-08 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\") } } } ``` |"]]