Shasya Bhatnagar
05/04/2022, 11:21 AMdef localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 32
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
androidExtensions{
experimental = true
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (<https://developer.android.com/studio/build/application-id.html>).
applicationId "com.example.code_with_patel"
minSdkVersion 19
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Vampire
05/04/2022, 11:42 AMandroid { ... }
closure.
Unfortunately the Groovy DSL does not show a better error message. That's one of the reasons I greatly prefer the Kotlin DSL. There you have amazing IDE support and type-safe build scripts with proper error messages.
In Groovy DSL the best I know to investigate in your case is either to see the error or to comment out everything and comment in line by line or block by block to find the culprit.Shasya Bhatnagar
05/04/2022, 12:32 PMVampire
05/04/2022, 2:27 PMandroid { ... }
closure starts. The problem is within that closureLouis Jacomet
05/05/2022, 11:53 AMAmanda