fat-aar-android
fat-aar-android copied to clipboard
Nothing is embedded in AAR with the latest Gradle 7
When using the latest Gradle version available, the build completes successfully (without any error messages), but all dependencies referenced with the embed keyword are missing in the output AAR. It works as expected when I downgrade the "Gradle Plugin" version to 4.2.2 again.
Build Environment
- Operating System: MacOS Catalina
- Gradle Plugin Version: 7.0.1
- Gradle Version: 7.2
- Fat-aar Version: 1.3.6
I've built the library myself from https://github.com/kezong/fat-aar-android/pull/338 and it works.
Edit: I've just had a look in https://github.com/kezong/fat-aar-android/issues/333 and it seems that the issue has been fixed with gradle plugin 7.0.1
@paramsen did you notices "[fataar] *** Can not resove"messages in build log?
@DDeg No, I'm not seeing any logs like that. As of now project dependencies referenced like embed project(path: ':module-name') and local files dependencies referenced embed files(path: 'file.aar') doesn't work, they aren't included in the output AAR. When I check the build log those dependencies aren't even mentioned in the output, seems like they are excluded from the build :)
@DDeg I am facing that exact issue, and am very interested in your open PR fix. How do you properly build the library from your repository https://github.com/DDeg/fat-aar-android/tree/wp/issue-333/0/android-gradle-plugin-7.0.0-support to use locally?
Hi, I managed to work around this issue by moving the aar to its own module like this.
Create a new directory lib2 and put the aar that you want to embed in there thus creating this directory structure:
lib2
|- lib2.aar
|- build.gradle
settings.gradle
mainLib
|- build.gradle
# lib2/build.gradle
configurations.maybeCreate("default")
artifacts.add("default", file("lib2.aar"))
# settings.gradle
include(":mainLib")
include(":lib2")
# mainLib/build.gradle
dependencies {
embed(project(":lib2"))
}
Gradle Plugin Version: 7.0.3 Gradle Version: 7.3.1 Fat-aar Version: 1.3.6
@paramsen You said this didn't work for you. Did you do all of the above steps?
@DDeg I got this notice : "[fataar] *** Can not resove" when I embed 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
Do you know how I can fix this ? Thanks!