0

I want a fat-aar plugin for my Android Library. I was using kezong in order to deliver x86_64 and amr64 code in the same arr, but kezong is not maintained and it's not working with gradle 8.0 .

So I tried to update kezong from the source on github. Notice that I am not very familiar with gradle and groovy, so I am trying, but maybe I make big mistakes doing this.

I first removed this plugins because it seems deprecated : //apply plugin: 'kotlin-android-extensions' and then I added: viewBinding = true

I also removed classifier because it seems not working.

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier = 'sources'
    //classifier = 'sources'
}

I am trying to build example and launch it which was working with gradle 7.2. But no luck with grdale 8.0.

Now I have another issue saying:

A problem occurred configuring project ':lib-main'.
Task with name 'transformClassesWithTransformRForFlavor1Debug' not found in project ':lib-main'.

Do you think I broke something disabling kotlin-android-extensions or maybe it's because I removed classifier or this is something else ?

Thanks!

SuperCed
  • 53
  • 5
  • I found this solution explained here : https://stackoverflow.com/questions/71496817/create-one-aar-from-multi-module-library-in-android/76512441#76512441 – SuperCed Jun 26 '23 at 09:20

1 Answers1

0

If I'm not mistaken, the fat-aar project does simply not work with Gradle 8.0 and up. Some APIs that the project uses are no longer support.

This is the output I get when I run fat-aar in Gradle 7.5.

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.
To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

There is already an issue on the Github site.

https://github.com/kezong/fat-aar-android/issues/409

The only option (IMHO) is currently to downgrade Gradle to a version before 8.0.

Aaron Dietz
  • 133
  • 1
  • 6