From c586027873b25b722f36f680e61f630a12921a0a Mon Sep 17 00:00:00 2001 From: Satyam Jha Date: Thu, 9 Jan 2025 16:06:34 +0530 Subject: [PATCH] fixing android build - reverted workflow changes --- android/app/build.gradle | 8 +++++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 4 ++-- lib/services/image_service.dart | 6 +++++ pubspec.lock | 12 +++++----- test/service_tests/image_service_test.dart | 24 +++++++++++++++++++ 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2ddef5c4e..52fe23ef0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,7 +33,7 @@ android { exclude 'META-INF/services/javax.annotation.processing.Processor' } - compileSdkVersion 35 + compileSdk 35 namespace "com.example.talawa" sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -53,6 +53,8 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 + // Flag to enable support for the new language APIs + coreLibraryDesugaringEnabled true } kotlinOptions { @@ -74,5 +76,7 @@ flutter { dependencies { implementation 'com.android.support:multidex:1.0.3' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22" + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4' + } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cfe88f690..2aaed3a1f 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 61f635fea..9d07da3f4 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,8 +19,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.2" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.10" apply false + id "com.android.application" version '8.7.1' apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false id("com.google.gms.google-services") version "4.4.1" apply false } diff --git a/lib/services/image_service.dart b/lib/services/image_service.dart index 9635f4389..380d61071 100644 --- a/lib/services/image_service.dart +++ b/lib/services/image_service.dart @@ -41,6 +41,9 @@ class ImageService { aspectRatioPresets: [ CropAspectRatioPreset.square, CropAspectRatioPreset.original, + CropAspectRatioPreset.ratio3x2, + CropAspectRatioPreset.ratio4x3, + CropAspectRatioPreset.ratio16x9, ], ), IOSUiSettings( @@ -48,6 +51,9 @@ class ImageService { aspectRatioPresets: [ CropAspectRatioPreset.square, CropAspectRatioPreset.original, + CropAspectRatioPreset.ratio3x2, + CropAspectRatioPreset.ratio4x3, + CropAspectRatioPreset.ratio16x9, ], ), ], diff --git a/pubspec.lock b/pubspec.lock index 2fa97ada2..538a7c5e3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -357,10 +357,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.3" file: dependency: "direct main" description: @@ -1685,10 +1685,10 @@ packages: dependency: transitive description: name: video_player_android - sha256: "7f8f25d7ad56819a82b2948357f3c3af071f6a678db33833b26ec36bbc221316" + sha256: e343701aa890b74a863fa460f5c0e628127ed06a975d7d9af6b697133fb25bdf url: "https://pub.dev" source: hosted - version: "2.4.11" + version: "2.7.1" video_player_avfoundation: dependency: transitive description: @@ -1757,10 +1757,10 @@ packages: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.5.4" win32_registry: dependency: transitive description: diff --git a/test/service_tests/image_service_test.dart b/test/service_tests/image_service_test.dart index b0c072685..fb74c78e7 100644 --- a/test/service_tests/image_service_test.dart +++ b/test/service_tests/image_service_test.dart @@ -101,6 +101,18 @@ void main() { androidSettings.aspectRatioPresets, contains(CropAspectRatioPreset.original), ); + expect( + androidSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio3x2), + ); + expect( + androidSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio4x3), + ); + expect( + androidSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio16x9), + ); expect( iosSettings.aspectRatioPresets, contains(CropAspectRatioPreset.square), @@ -109,6 +121,18 @@ void main() { iosSettings.aspectRatioPresets, contains(CropAspectRatioPreset.original), ); + expect( + iosSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio3x2), + ); + expect( + iosSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio4x3), + ); + expect( + iosSettings.aspectRatioPresets, + contains(CropAspectRatioPreset.ratio16x9), + ); }); test("error in crop image", () async {