|
| 1 | +// android/app/build.gradle |
| 2 | + |
1 | 3 | plugins { |
2 | 4 | id "com.android.application" |
3 | 5 | id "kotlin-android" |
4 | 6 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. |
5 | 7 | id "dev.flutter.flutter-gradle-plugin" |
6 | 8 | } |
7 | 9 |
|
| 10 | +// Load the Keystore Properties |
8 | 11 | def keystoreProperties = new Properties() |
9 | 12 | def keystorePropertiesFile = rootProject.file('key.properties') |
10 | 13 | if (keystorePropertiesFile.exists()) { |
@@ -45,20 +48,25 @@ android { |
45 | 48 |
|
46 | 49 | signingConfigs { |
47 | 50 | release { |
| 51 | + // FIX: Use a conditional check (the Elvis operator ?: '') |
| 52 | + // to ensure 'file()' never gets a null or missing path string. |
| 53 | + // This is the source of the path='null' error. |
48 | 54 | keyAlias = keystoreProperties['keyAlias'] |
49 | 55 | keyPassword = keystoreProperties['keyPassword'] |
50 | | - storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null |
| 56 | + storeFile = file(keystoreProperties['storeFile'] ?: '') // <--- CRITICAL FIX |
51 | 57 | storePassword = keystoreProperties['storePassword'] |
52 | 58 | v1SigningEnabled = true |
53 | 59 | v2SigningEnabled = true |
54 | 60 | } |
55 | | - } |
| 61 | + } // Line 56 is near here, depending on your exact formatting |
56 | 62 |
|
57 | 63 | buildTypes { |
58 | 64 | release { |
59 | | - // TODO: Add your own signing config for the release build. |
60 | | - // Signing with the debug keys for now, so `flutter run --release` works. |
61 | | - signingConfig = signingConfigs.release |
| 65 | + // Revert to unconditional assignment. If storeFile is missing, |
| 66 | + // Gradle will now error with "storeFile is missing required property", |
| 67 | + // which is clearer than the "path='null'" error. |
| 68 | + signingConfig signingConfigs.release |
| 69 | + |
62 | 70 | minifyEnabled = false |
63 | 71 | shrinkResources = false |
64 | 72 | } |
|
0 commit comments