From 64f4065a8d0a67db8985de416c0efbf817f9fc95 Mon Sep 17 00:00:00 2001 From: Seunghyun Min Date: Thu, 17 Oct 2024 14:53:26 +0900 Subject: [PATCH] FIx android build failed after upgrading android studio to Ladybug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 발생했던 문제 순으로 참고한 링크: https://github.com/flutter/flutter/issues/156453 https://github.com/flutter/flutter/issues/156111#issuecomment-2401079483 https://github.com/flutter/flutter/issues/156304#issuecomment-2397707812 https://stackoverflow.com/questions/76108428/how-do-i-fix-namespace-not-specified-error-in-android-studio https://github.com/hui-z/image_gallery_saver/issues/272 https://github.com/hui-z/image_gallery_saver/pull/295 --- android/app/build.gradle | 6 +++--- android/app/src/debug/AndroidManifest.xml | 3 +-- android/app/src/main/AndroidManifest.xml | 3 +-- android/app/src/profile/AndroidManifest.xml | 5 ++--- android/build.gradle | 12 ++++++++++++ android/gradle.properties | 1 - android/gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 4 ++-- pubspec.lock | 13 +++++++------ pubspec.yaml | 5 ++++- 10 files changed, 33 insertions(+), 21 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d26b0cd9..7a05adef 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -35,12 +35,12 @@ android { compileSdkVersion 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = 17 } sourceSets { diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index df9be524..7c2a56ce 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9c7d676f..df2d6606 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 765af4de..892d4b3c 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,7 +1,6 @@ - + - + diff --git a/android/build.gradle b/android/build.gradle index b42eb3a7..8abe0b87 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,6 +3,18 @@ allprojects { google() mavenCentral() } + + subprojects { + afterEvaluate { project -> + if (project.hasProperty('android')) { + project.android { + if (namespace == null) { + namespace project.group + } + } + } + } + } } rootProject.buildDir = '../build' diff --git a/android/gradle.properties b/android/gradle.properties index c396be2a..94adc3a3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,3 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -android.bundle.enableUncompressedNativeLibs=false diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cfe88f69..db18181a 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.10.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index ba77faa6..341876f1 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,12 +18,12 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.2.2" apply false + id "com.android.application" version "8.2.2" apply false // START: FlutterFire Configuration id "com.google.gms.google-services" version "4.3.15" apply false id "com.google.firebase.crashlytics" version "2.9.9" apply false // END: FlutterFire Configuration - id "org.jetbrains.kotlin.android" version "1.7.20" apply false + id "org.jetbrains.kotlin.android" version "2.0.20" apply false } include ":app" diff --git a/pubspec.lock b/pubspec.lock index 7ca91230..132718c5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -958,10 +958,11 @@ packages: image_gallery_saver: dependency: "direct main" description: - name: image_gallery_saver - sha256: "0aba74216a4d9b0561510cb968015d56b701ba1bd94aace26aacdd8ae5761816" - url: "https://pub.dev" - source: hosted + path: "." + ref: knottx + resolved-ref: "05675bd4d70f3f4dfd702ae4f0075fa09025c436" + url: "https://github.com/knottx/image_gallery_saver.git" + source: git version: "2.0.3" image_picker: dependency: "direct main" @@ -1136,10 +1137,10 @@ packages: description: path: just_audio ref: "fix/memory-leak" - resolved-ref: aaff56c51209bb03bd8b33e4779590be2c68eecc + resolved-ref: a9e373f4102ae9e3ee9a0aebbf6a77a7bd89f13d url: "https://github.com/silgam/just_audio" source: git - version: "0.9.20" + version: "0.9.41" just_audio_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6c4b1894..9cfca30f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,7 +45,10 @@ dependencies: screenshot: ^3.0.0 path_provider: ^2.1.4 share_plus: ^10.0.0 - image_gallery_saver: ^2.0.3 + image_gallery_saver: + git: + url: https://github.com/knottx/image_gallery_saver.git + ref: knottx carousel_slider: ^5.0.0 smooth_page_indicator: ^1.2.0+3 google_mobile_ads: ^5.1.0