02021b540e
Routes Flutter framework errors (FlutterError.onError) and uncaught async/platform errors (PlatformDispatcher.onError) to Crashlytics, but only in release builds — debug keeps its red error screens and console traces, and collection is disabled via setCrashlyticsCollectionEnabled (kReleaseMode) so development crashes never reach the dashboard. Adds the Crashlytics Gradle plugin alongside the existing google-services FlutterFire config. iOS dSYM upload run script still to be added in Xcode (symbolication only; crash capture works without it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
75 lines
2.4 KiB
Kotlin
75 lines
2.4 KiB
Kotlin
import java.io.FileInputStream
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
// START: FlutterFire Configuration
|
|
id("com.google.gms.google-services")
|
|
id("com.google.firebase.crashlytics")
|
|
// END: FlutterFire Configuration
|
|
id("kotlin-android")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
// Release signing is read from android/key.properties (gitignored). When that
|
|
// file is absent (CI, a fresh clone, another machine) the release build falls
|
|
// back to debug signing so `flutter build`/`flutter run --release` still works.
|
|
val keystoreProperties = Properties()
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "com.airkjw.block_seasons"
|
|
compileSdk = flutter.compileSdkVersion
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
// Store-facing application id; the internal namespace keeps the
|
|
// generated package name.
|
|
applicationId = "com.airkjw.blockseasons"
|
|
// You can update the following values to match your application needs.
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
minSdk = flutter.minSdkVersion
|
|
targetSdk = flutter.targetSdkVersion
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
if (keystorePropertiesFile.exists()) {
|
|
keyAlias = keystoreProperties["keyAlias"] as String
|
|
keyPassword = keystoreProperties["keyPassword"] as String
|
|
storeFile = file(keystoreProperties["storeFile"] as String)
|
|
storePassword = keystoreProperties["storePassword"] as String
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig = if (keystorePropertiesFile.exists()) {
|
|
signingConfigs.getByName("release")
|
|
} else {
|
|
signingConfigs.getByName("debug")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|