DEV Community

sidcode
sidcode

Posted on

Gradle upgrade

1- android/gradle/warpper/gradle-warpapper.peroperies(2024/08/02 or 02/08/2024)

distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
Enter fullscreen mode Exit fullscreen mode

2- android/build.gradle (AGP Upgrade : *add buildscript{ })

buildscript { 
// 목적: buildscript 블록은 빌드 스크립트 자체에 필요한 의존성 및 플러그인을 정의합니다.
// Purpose: The buildscript block defines the dependencies and plugins required for the build script itself.
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.5.1' // 최신 버전으로 업데이트
    }
}

allprojects {
// 목적: allprojects 블록은 루트 프로젝트와 모든 하위 프로젝트에 공통적으로 적용할 설정을 정의합
// Purpose: The allprojects block defines settings that apply to the root project and all subprojects.
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = "../build"
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

Enter fullscreen mode Exit fullscreen mode

3- android/settings.gradle ( id "com.android.application" version "8.5.1" apply false)

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.5.1" apply false
    id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
Enter fullscreen mode Exit fullscreen mode

4- rebuild Gradle

$ cd /mypackage/android
$ ./gradlew clean build     
                                                                                                         ─╯
> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libVkLayer_khronos_validation.so, libflutter.so.

> Task :app:stripProfileDebugSymbols
Unable to strip the following libraries, packaging them as they are: libapp.so, libflutter.so, libvmservice_snapshot.so.

> Task :app:stripReleaseDebugSymbols
Unable to strip the following libraries, packaging them as they are: libapp.so, libflutter.so.

> Task :app:lintReportDebug
Wrote HTML report to file:///Users/sidcode/Developer/flutter_workspace/jiyulsadventure/build/app/reports/lint-results-debug.html

> Task :app:minifyReleaseWithR8
Supplied proguard configuration does not exist: /Users/sidcode/Developer/flutter_workspace/jiyulsadventure/android/app/proguard-rules.pro

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 37s
159 actionable tasks: 146 executed, 13 up-to-date
Enter fullscreen mode Exit fullscreen mode

Top comments (0)