From b39506a6039fe6db8be72987592837293fd2430c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:09:13 +0000 Subject: [PATCH 1/2] Bump com.android.tools.build:gradle in the gradle-dependencies group Bumps the gradle-dependencies group with 1 update: com.android.tools.build:gradle. Updates `com.android.tools.build:gradle` from 8.13.2 to 9.0.0 --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: gradle-dependencies ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6c37d7e..f3820da 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { //Android Gradle Plugin (AGP) - classpath "com.android.tools.build:gradle:8.13.2" + classpath "com.android.tools.build:gradle:9.0.0" //Kotlin classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0" From 491bcddc1c40451e3e4e33679d5ae39e07c9d148 Mon Sep 17 00:00:00 2001 From: JD Porterfield Date: Fri, 16 Jan 2026 12:59:30 -0800 Subject: [PATCH 2/2] fix build and add notes to README --- README.md | 32 ++++++++++++++++++++++++++++++++ app/build.gradle | 9 +++++---- gradle.properties | 2 ++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 82bc415..2c03881 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,27 @@ Each release version for this sample project will correspond to the same AGP ver ## Notes +### Important: AGP 9.0.0 and AndroidAspectExample EOL + +It seems this project is on its last legs with the introduction of AGP 9.0.0. It shouldn't matter too +much since this is just a sample project, but heads up that since AGP will be updating their DSL in 9.0.0 +and removing it in the near future, this project will stop working. This is because the underlying +Aspect library [gradle-aspectj-pipeline-plugin] is no longer maintained since 2023 so has not updated +to the new DSL. + +For now, i.e. at least the first major release of AGP 9, this can be worked around by using the following +flag in `gradle.properties`: + +```text +android.newDsl=false +``` + +As mentioned below, I do not personally recommend AspectJ anymore but if you still prefer to use it, +there do seem to be alternatives out there under active development, such as [AndroidAOP]. I have not +personally vetted that library but it does appear to be pretty active and have a decent amount of stars. + +This project will be updated until the `newDsl` flag is removed after which I will probably archive the project. + #### Plugin Change As of v4.1.0, this sample project leverages the following Gradle Plugin for weaving aspects: @@ -38,6 +59,16 @@ kotlinOptions { } ``` +If you are using a version of Kotlin/AGP where `kotlinOptions` has been deprecated or removed, you can use the following +```groovy +kotlin { + compilerOptions { + freeCompilerArgs = ["-Xsam-conversions=class"] + } +} +``` + + You can read more about the issue [here] if interested. #### Using newer versions of AspectJ @@ -90,3 +121,4 @@ and playing around with the sample project. [Why I Don't Recommend Aspect-Oriented Programming in Android in 2023]: https://jdvp.me/articles/AOP-in-Android-2023 [would not be broken]: https://github.com/Ibotta/gradle-aspectj-pipeline-plugin/issues/34 [desugaring]: https://android-developers.googleblog.com/2023/02/api-desugaring-supporting-android-13-and-java-nio.html +[AndroidAOP]: https://github.com/FlyJingFish/AndroidAOP \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 793939f..1b26875 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: "com.android.application" -apply plugin: "kotlin-android" apply plugin: "com.ibotta.gradle.aop" java { @@ -30,7 +29,7 @@ android { } release { minifyEnabled false - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), "proguard-rules.pro" } } @@ -41,8 +40,10 @@ android { issue here: https://github.com/Ibotta/gradle-aspectj-pipeline-plugin/issues/8 */ - kotlinOptions { - freeCompilerArgs = ["-Xsam-conversions=class"] + kotlin { + compilerOptions { + freeCompilerArgs = ["-Xsam-conversions=class"] + } } testOptions { diff --git a/gradle.properties b/gradle.properties index 36a2b0c..db95243 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,3 +16,5 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +android.newDsl=false \ No newline at end of file