I know I'm supposed to follow this guide https://docs.flutter.dev/deployment/android#signing-the-app
and I had no problem while executing the first 2 steps, but I'm confused at the 3rd step.
First they ask me to edit the android/app/build.gradle file, but I was only able to find build.gradle.kts, which I assumed was similar. However they then ask me to add this
def keystoreProperties = new Properties()
def keystorePropertiesFile
rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new
FileInputStream(keystorePropertiesFile))
}
before the android block, which doesn't exist.
I then searched for another build.gradle file, and found 2 more.
One is in android/app/app, which had the android block, but the BuildTypes block was different.
instead of getting this
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
I got this
buildTypes { getByName("debug") { manifestPlaceholders["usesCleartextTraffic"] = "true" isDebuggable = true isJniDebuggable = true isMinifyEnabled = false packagingOptions { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so") jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so") jniLibs.keepDebugSymbols.add("*/x86/*.so") jniLibs.keepDebugSymbols.add("*/x86_64/*.so") } } getByName("release") { isMinifyEnabled = false proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") } }
I was afraid that copy pasting the code straight from the flutter docs wouldn't work.
And the 2 build.gradle file, was also missing the android block.
So what do I do?