fat aar - gradle 8.0 - kezong

pbgvytdp  于 2023-05-18  发布在  其他
关注(0)|答案(1)|浏览(581)

我想为我的Android库一个胖-aar插件。我使用kezong是为了在同一个arr中交付x86_64和amr 64代码,但是kezong没有维护,它不能在gradle 8.0中工作。
所以我试着从github上的源代码更新kezong。请注意,我不是很熟悉gradle和groovy,所以我正在尝试,但也许我在这样做时犯了很大的错误。
我第一次删除这个插件是因为它似乎已经过时了://apply plugin: 'kotlin-android-extensions'然后我添加了:viewBinding = true
我还删除了分类器,因为它似乎不工作。

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

我试图建立一个例子,并启动它是与Gradle 7.2工作。但没有运气与grdale 8. 0。
现在我有另一个问题说:

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

你认为我破坏了禁用kotlin-android-extensions的东西,或者可能是因为我删除了classifier,或者这是其他原因?
谢谢!

svdrlsy4

svdrlsy41#

如果我没有弄错的话,fat-aar项目根本不适用于Gradle 8.0及更高版本。项目使用的某些API不再受支持。
这是我在Gradle 7.5中运行fat-aar时得到的输出。

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.

在Github网站上有一个问题。
https://github.com/kezong/fat-aar-android/issues/409
目前唯一的选择(恕我直言)是将Gradle降级到8.0之前的版本。

相关问题