kezong / fat-aar-android

A gradle plugin that merge dependencies into the final aar file works with AGP 3.+
MIT License
3.08k stars 607 forks source link

Support for Gradle 8+, AGP 8+ #409

Open talothman opened 1 year ago

talothman commented 1 year ago

Describe the issue

In AGP 8.0, the com.android.build.api.transform package was removed. This api is mainly used here and causes fat-aar to fail to build in the environment described below.

This results in previously passing builds that use fat-aar failing with exceptions like:

> Task with name 'transformClassesWithTransformRForDebug' not found in project ':sampleproject'.

Are there plans to support this plugin for Gradle 8+, AGP 8+?

Build Environment

akamaccio commented 1 year ago

Unfortunately this is the announced issue caused by AGP 8+.

API 'android.registerTransform' is obsolete. It will be removed in version 8.0 of the Android Gradle plugin. The Transform API is removed to improve build performance. Projects that use the Transform API force the Android Gradle plugin to use a less optimized flow for the build that can result in large regressions in build times. It’s also difficult to use the Transform API and combine it with other Gradle features; the replacement APIs aim to make it easier to extend the build without introducing performance or correctness issues.

There is no single replacement for the Transform API—there are new, targeted APIs for each use case. All the replacement APIs are in the androidComponents {} block.

The Transform API uses incremental APIs deprecated since Gradle 7.5. Please add android.experimental.legacyTransform.forceNonIncremental=true to gradle.properties to fix this issue. Note that this will run transforms non-incrementally and may have a build performance impact. For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.

This wonderful plugin seems to be no more maintained. The puzzling thing is that Google every single update uses to make our lives more and more difficult.

My current "solution" is to revert the AGP to 7.4.x. Maybe a Gradle script language expert could help us to fix this issue.

LaurynasM-iproyal commented 1 year ago

Android really does not want anyone to package local .aar into their libraries

aasitnikov commented 1 year ago

You can use version from PR #411, that replaces old Transform API with new ASM transformer API. You can use latest release from this fork https://github.com/aasitnikov/fat-aar-android