Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Gradle 8+, AGP 8+ #409

Open
talothman opened this issue Apr 7, 2023 · 3 comments
Open

Support for Gradle 8+, AGP 8+ #409

talothman opened this issue Apr 7, 2023 · 3 comments

Comments

@talothman
Copy link

talothman commented Apr 7, 2023

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

  • Operating System: [e.g. MacOS]
  • Gradle Plugin Version: [e.g. 8.0]
  • Gradle Version: [e.g. 8.0.2]
  • Fat-aar Version: [e.g. 1.3.8]
@akamaccio
Copy link

akamaccio commented Apr 17, 2023

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
Copy link

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

@aasitnikov
Copy link

You can use version from PR #411, that replaces old Transform API with new ASM transformer API.

gildor added a commit to bandlab/Amplitude-Kotlin that referenced this issue Aug 23, 2023
Those changes required if you want too use project as included build for an app which already uses AGP 8. So it allows to debug or experiment with Amplitude SDK as part of your own project

- Update Kotlin 1.9.0 and AGP 8.1.0, Gradle 8.2.1
- Removed fat-aar because it's not compatible with AGP 8 (see kezong/fat-aar-android#409), so no dependencies packaging into single AAR anymore, it affects publishing, but doesn't affect if repo used as included build
- Fix incompatibility with AGP 8 DSL: added namepaces, enabled required buildFeatures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants