Skip to content

Support AGP 8.0+ - #411

Open
aasitnikov wants to merge 6 commits into
kezong:masterfrom
aasitnikov:support-agp80
Open

Support AGP 8.0+#411
aasitnikov wants to merge 6 commits into
kezong:masterfrom
aasitnikov:support-agp80

Conversation

@aasitnikov

@aasitnikov aasitnikov commented Jun 2, 2023

Copy link
Copy Markdown

This pull request adds support for AGP 8.0.

Note that this branch includes fix from #403.

To get this version into your project, you can use jitpack as follows:

allprojects {
    repositories {
        ...
        maven {
            setUrl("https://jitpack.io")
            content { includeGroup("com.github.aasitnikov") }
        }
    }
}

dependencies {
    implementation("com.github.aasitnikov:fat-aar-android:b2a038763c")
}

@KindiiV

KindiiV commented Jun 7, 2023

Copy link
Copy Markdown

@aasitnikov I have an error: Cause: {module_name} module's AndroidManifest not found.
But this module has AndroidManifest file and it was working before Gradle 8, what can be wrong?

@TVDiasDominik

TVDiasDominik commented Jun 14, 2023

Copy link
Copy Markdown

same for me the first lib i do embed will end in this error
Caused by: org.gradle.api.internal.tasks.properties.PropertyEvaluationException: Error while evaluating property 'visitorsList.$0.parameters.libraryNamespaces' of task ':app:transformDebugClassesWithAsm'.
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of property 'libraryNamespaces'.

@ralikhachev

ralikhachev commented Jun 19, 2023

Copy link
Copy Markdown

@aasitnikov Hello, there are problems (AGP: 8.0.2, Gradle: 8.1.1)

Configuration 'embed' was resolved during configuration time.
This is a build performance and scalability issue.
See gradle/gradle#2298
Run with --info for a stacktrace.
java.lang.RuntimeException: Configuration 'embed' was resolved during configuration time.
This is a build performance and scalability issue.
See gradle/gradle#2298
at com.android.build.gradle.internal.DependencyResolutionChecks$registerDependencyCheck$4$1.execute(DependencyResolutionChecks.kt:72)

Task :sdk:transformDebugClassesWithAsm FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':sdk:transformDebugClassesWithAsm'.

Error while evaluating property 'visitorsList.$0.parameters.libraryNamespaces' of task ':sdk:transformDebugClassesWithAsm'.
Failed to calculate the value of property 'libraryNamespaces'.
> test module's AndroidManifest not found

AGP: 7.2.0, Gradle: 7.6: Works without errors

@AndreasBoehm

AndreasBoehm commented Jun 20, 2023

Copy link
Copy Markdown

Hi @aasitnikov,

i tried to update my fork with your changes but unfortunately i do get the same error that others reported as soon as i use AGP 8.0.0 or higher.

After a first look it looks like you are trying to access the AndroidManifest of the exploded aar before you explode the aar.

Maybe you have an idea how to resolve this error.

Best regards,
Andi

@aasitnikov

aasitnikov commented Aug 23, 2023

Copy link
Copy Markdown
Author

I figured out potential issue, try "com.github.aasitnikov:fat-aar-android:b2a038763c" to see if it works for you

@thisisatestuseraccount

Copy link
Copy Markdown

Merged into an off-site repo, builds are successful. Thank you for bothering to fix what Google won't even develop.

@AndreasBoehm

AndreasBoehm commented Sep 5, 2023

Copy link
Copy Markdown

Thanks a lot @aasitnikov !

I used AGP 8.1.1 and gradle 8.3 and it's working fine now.

@RedRackham1994

Copy link
Copy Markdown

Thanks for the fix! Successfully used in gradle 8.3 :D

@flasher297

Copy link
Copy Markdown

If you struggle with connecting this fix via Kotlin DSL use this approach:
Add these closures to the settings.gradle

pluginManagement {
    repositories {
        maven {
            setUrl("https://jitpack.io")
            content { includeGroup("com.github.aasitnikov") }
        }
    }
}

In the root build.gradle.kts you have to use the old buildScript approach because I haven't figured out how to find plugin ID to add it to the plugins block.

buildscript {
    dependencies {
        classpath("com.github.aasitnikov:fat-aar-android:ce932b38ef")
    }
}

Finally, add the plugin in build.gradle.kts of your module.

plugins {
    ....
    id("com.kezong.fat-aar")
}

@dh336699

Copy link
Copy Markdown

If you struggle with connecting this fix via Kotlin DSL use this approach: Add these closures to the settings.gradle

pluginManagement {
    repositories {
        maven {
            setUrl("https://jitpack.io")
            content { includeGroup("com.github.aasitnikov") }
        }
    }
}

In the root build.gradle.kts you have to use the old buildScript approach because I haven't figured out how to find plugin ID to add it to the plugins block.

buildscript {
    dependencies {
        classpath("com.github.aasitnikov:fat-aar-android:ce932b38ef")
    }
}

Finally, add the plugin in build.gradle.kts of your module.

plugins {
    ....
    id("com.kezong.fat-aar")
}

@flasher297
Hey guy, I just did as you say, it still threw error in Android Studio as below:
image

@bugDim88

bugDim88 commented Oct 20, 2023

Copy link
Copy Markdown

Hi @aasitnikov. Try you patch on my project. Versions:
agp 8.1, gradle 8.3.

Looks like result lib.aar missing jar file with R classes. Application with aar like this fails.
In attached screenshot you can see example of R classes jar file that missing in patched fat-aar output.
What can be wrong?
aar_tree

@HamzaOban

Copy link
Copy Markdown

Thank you @aasitnikov it's working.

@dyguests

dyguests commented Dec 12, 2023

Copy link
Copy Markdown

Works for me!

: gradle 8.0

And here is my changed files:

root settings.gradle

pluginManagement {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
        ...
    }
}

root build.gradle

buildscript{
    dependencies {
        // classpath 'com.github.kezong:fat-aar:1.3.8'
        classpath("com.github.aasitnikov:fat-aar-android:b2a038763c")
    }
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    ...
}

the sdk need embed. build.gradle

plugins {
    ...
    id 'com.kezong.fat-aar'
}

@gaoruiqing187

Copy link
Copy Markdown

@dyguests 老哥,我的依然没成功,能留个联系方式交流交流吗

@dyguests

Copy link
Copy Markdown

@dyguests 老哥,我的依然没成功,能留个联系方式交流交流吗

我上面的回复,已经是我全部修改内容啦 ,没别的办法啦。

@TVDiasDominik

Copy link
Copy Markdown

@aasitnikov today i tried updating to gradle 8.6 and it does not work anymore. Can you maybe also fix it for 8.6?

@lsuski

lsuski commented Feb 19, 2024

Copy link
Copy Markdown

@MichaelNien

Copy link
Copy Markdown

Support AGP 8.3.1 ?

@aasitnikov

Copy link
Copy Markdown
Author

Try out https://github.com/aasitnikov/fat-aar-android with AGP 8.3.0 support

@jike1502jt

Copy link
Copy Markdown

@dyguests 老哥,我的依然没成功,能留个联系方式交流交流吗

我上面的回复,已经是我全部修改内容啦 ,没别的办法啦。

Works for me!

: gradle 8.0

And here is my changed files:

root settings.gradle

pluginManagement {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
        ...
    }
}

root build.gradle

buildscript{
    dependencies {
        // classpath 'com.github.kezong:fat-aar:1.3.8'
        classpath("com.github.aasitnikov:fat-aar-android:b2a038763c")
    }
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    ...
}

the sdk need embed. build.gradle

plugins {
    ...
    id 'com.kezong.fat-aar'
}

dependencies依赖的还是用embed project吗?

@jike1502jt

Copy link
Copy Markdown

This pull request adds support for AGP 8.0.

Note that this branch includes fix from #403.

To get this version into your project, you can use jitpack as follows:

allprojects {
    repositories {
        ...
        maven {
            setUrl("https://jitpack.io")
            content { includeGroup("com.github.aasitnikov") }
        }
    }
}

dependencies {
    implementation("com.github.aasitnikov:fat-aar-android:b2a038763c")
}

image
我用了报这个是什么问题,我gradle版本是8.01

@dyguests

Copy link
Copy Markdown

@jike1502jt 我真不知道了。
而且这个方案我们已经废弃了,新方案都没用 fat-aar 了。
现在我都没做这个项目了。

@jike1502jt

Copy link
Copy Markdown

@jike1502jt 我真的不知道了。 而且这个方案我们已经荒废了,新方案都已经用 fat-aar 了。 现在我已经不再做这个项目了。

fat-aar 不是不支持gradle8以上吗?

@MichaelNien

Copy link
Copy Markdown

Try out https://github.com/aasitnikov/fat-aar-android with AGP 8.3.0 support

Support AGP 8.5.x ?

@aasitnikov

Copy link
Copy Markdown
Author

Try out latest release with AGP 8.5 support at https://github.com/aasitnikov/fat-aar-android

@aasitnikov aasitnikov changed the title Support AGP 8.0 Support AGP 8.0+ Jun 24, 2024
damianogiusti added a commit to empatica/fat-aar-android that referenced this pull request Sep 18, 2024
@mxiangyu

mxiangyu commented Feb 11, 2025

Copy link
Copy Markdown

@liuanxin

Copy link
Copy Markdown

Try out latest release with AGP 8.5 support at https://github.com/aasitnikov/fat-aar-android

老哥, 你 fork 之后的项目, 我在本地怎么都没能跑成功

gradle 版本: 8.7

# 在 example/build.gradle 中
# buildscript -> repositories 下添加
maven {
    setUrl("https://jitpack.io")
    content {
        includeGroup("com.github.aasitnikov")
    }
}

# buildscript -> dependencies 下修改下面版本
classpath 'com.android.tools.build:gradle:8.5.0'
classpath 'com.github.aasitnikov:fat-aar-android:1.4.1'

在 example/gradle/wrapper/gradle-wrapper.properties 修改成 8.7

在 example/settings.gradle 中注释 includeBuild 部分

之后在 example 目录下执行 ./gradlew :lib-main:assemble 各种想不到的错误, 处理完一个又来一下, 被 gradle 整得一点脾气都没了

@Goooler

Goooler commented Jun 16, 2025

Copy link
Copy Markdown

See #429.

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

Successfully merging this pull request may close these issues.