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 flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } // key.properties MUST have password placeholders filled in (via drone with secrets) and cwtch-upload.jks file must be added (from drone secret) def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } android { compileSdkVersion 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' main.jniLibs.srcDirs += 'src/main/libs' } lintOptions { disable 'InvalidPackage' // For some reason we get Error: LottieAnimationView must extend android.view.View // Given the newer gradle build...I'm not sure why, but it does impact functionality at all // there is no information about this error and the command output suggests including the // following: abortOnError false } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "im.cwtch.flwtch" minSdkVersion 19 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } 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 signingConfig signingConfigs.release } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21" // same as kotlin version in settings.gradle implementation fileTree( dir: 'cwtch') implementation files ('cwtch/cwtch.aar') implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2" implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0" implementation "com.android.support.constraint:constraint-layout:2.0.4" // Test Dependencies testImplementation 'junit:junit:4.12' // https://developer.android.com/jetpack/androidx/releases/test/#1.2.0 androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' // WorkManager // (Java only) //implementation("androidx.work:work-runtime:$work_version") // Kotlin + coroutines // 2022.06: upgraded from 2.5 to 2.7 for android 12 // err: "requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent" // as per https://github.com/flutter/flutter/issues/93609 implementation 'androidx.work:work-runtime-ktx:2.7.0' // optional - RxJava2 support //implementation("androidx.work:work-rxjava2:$work_version") // optional - GCMNetworkManager support //implementation("androidx.work:work-gcm:$work_version") // optional - Test helpers //androidTestImplementation("androidx.work:work-testing:$work_version") // optional - Multiprocess support implementation "androidx.work:work-multiprocess:2.5.0" // end of workmanager deps // needed to prevent a ListenableFuture dependency conflict/bug // see https://github.com/google/ExoPlayer/issues/7905#issuecomment-692637059 implementation "com.google.guava:guava:31.0.1-android" }