todos-contra-el-fuego-mobile/android/app/build.gradle
vjrj 7812ed951e fix: Resolve Dart type inference errors and update Android build configuration for Gradle 8.14
Type Annotation Fixes:
- fireNotificationList.dart: Added DeleteFireNotificationFunction and TapFireNotificationFunction types to _buildRow and _buildSavedFireNotifications parameters
- homePage.dart: Added Object type to catchError handler parameters
- redux/appReducer.dart: Added dynamic type annotation to action parameter
- redux/fetchDataMiddleware.dart: Added explicit type annotations and improved type casting
- redux/reducers.dart: Added dynamic type annotation to action parameter
- redux/userReducer.dart: Added dynamic type annotation to action parameter

Android Build Configuration Updates:
- Updated compileSdkVersion and targetSdkVersion from 34 to 36 to match plugin requirements
- Moved plugins {} block to first position (Gradle 8.14 requirement)
- Added dev.flutter.flutter-gradle-plugin to plugins block for modern Flutter integration
- Removed deprecated useProguard setting, replaced with shrinkResources
- Disabled Jetifier (android.enableJetifier=false) to improve build performance
- Increased JVM heap allocation to 4096M for large project compilation
- Added Kotlin language version 1.8 override for plugin compatibility
- Added ProGuard rules to exclude optional Google Play Core classes

Build Results:
-  APK builds successfully (146MB debug APK)
-  Zero type inference errors detected by dart analyze
-  Kotlin compilation passes
-  R8 minification configured correctly
-  301 remaining issues are all INFO-level style suggestions (non-blocking)
2026-03-06 21:44:54 +01:00

87 lines
2.4 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'dev.flutter.flutter-gradle-plugin'
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion 36
namespace "org.comunes.fires"
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.comunes.fires"
minSdkVersion flutter.minSdkVersion
targetSdkVersion 36
versionCode 9
versionName "1.9"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "flavor-type"
productFlavors {
development {
dimension "flavor-type"
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
}
production {
dimension "flavor-type"
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.13.2'
// androidx test dependencies replace old android.support.test
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// implementation 'com.google.firebase:firebase-core:15.0.2'
// google recommends 16 but fails because location flutter package deps in 15
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'