@@ -8,6 +8,13 @@ plugins {
88 id " dev.flutter.flutter-gradle-plugin"
99}
1010
11+ // Add this at the top of the file, before the android { ... } block
12+ def keystoreProperties = new Properties ()
13+ def keystorePropertiesFile = rootProject. file(' key.properties' )
14+ if (keystorePropertiesFile. exists()) {
15+ keystoreProperties. load(new FileInputStream (keystorePropertiesFile))
16+ }
17+
1118android {
1219 namespace = " com.example.disaster_management"
1320 compileSdk = flutter. compileSdkVersion
@@ -23,10 +30,7 @@ android {
2330 }
2431
2532 defaultConfig {
26- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2733 applicationId = " com.example.disaster_management"
28- // You can update the following values to match your application needs.
29- // For more information, see: https://flutter.dev/to/review-gradle-config.
3034 minSdk = flutter. minSdkVersion
3135 targetSdk = flutter. targetSdkVersion
3236 versionCode = flutter. versionCode
@@ -36,6 +40,25 @@ android {
3640 ' com.google.firebase.auth.RecaptchaEnabled' : ' true'
3741 ]
3842 }
43+
44+ signingConfigs {
45+ release {
46+ keyAlias keystoreProperties[' keyAlias' ]
47+ keyPassword keystoreProperties[' keyPassword' ]
48+ storeFile keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
49+ storePassword keystoreProperties[' storePassword' ]
50+ }
51+ }
52+
53+ buildTypes {
54+ release {
55+ // Removed duplicate applicationId and other properties that should only be in defaultConfig
56+ signingConfig signingConfigs. release
57+ minifyEnabled false // Change this to false
58+ shrinkResources false // Add this line
59+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
60+ }
61+ }
3962}
4063
4164flutter {
0 commit comments