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

fix missing resources when using AGP 7.3.X #403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndreasBoehm
Copy link

@AndreasBoehm AndreasBoehm commented Nov 15, 2022

Fixes

Changelog

  • use registerGeneratedResFolders to merge resources

Use the fixed version in your project

Until this MR gets merged you need to use jitpack to get a version of the library that includes this fix.
I created a new branch for this because i also had to modify the publishing config: https://github.com/AndreasBoehm/fat-aar-android/tree/fix-missing-resources-jitpack

Details can be found here: https://jitpack.io/#AndreasBoehm/fat-aar-android/da3ac00990

@BlueTurtle3
Copy link

Thanks for sharing this AndreasBoehm

@tareq-threls
Copy link

Hi @AndreasBoehm, Thanks for your help, Would you please guide me about, How I can use your branch, in my code as classpath? Thanks in advance

@AndreasBoehm
Copy link
Author

HI @tareq-threls,
i added a guide to the MR description that describes how you can use those changes in your project.

@Hasan-rapido
Copy link

Hi @AndreasBoehm could you please check this issue once #406

@AndreasBoehm
Copy link
Author

Hi @AndreasBoehm could you please check this issue once #406

You need to use the fixed version of the library to fix this issue.
Please take a look at the the description of this issue (#403) for how to do that.

@Hasan-rapido
Copy link

Hi @AndreasBoehm could you please check this issue once #406

You need to use the fixed version of the library to fix this issue. Please take a look at the the description of this issue (#403) for how to do that.

I integrated the jitpack library you mentioned above, but still the fat-aar not including the drawables.

@karntrehan
Copy link

Hie @AndreasBoehm thank you for trying to fix this.

We implemented the changes you mentioned but are getting the following errors:

> Task :sample:processDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml","position":{"startLine":20}}],"original":"ERROR:/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml:21: AAPT: error: attribute navGraph (aka com.example.odkshellapp:navGraph) not found.\n    ","tool":"AAPT"}
....

Execution failed for task ':sample:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml:21: AAPT: error: attribute navGraph (aka com.example.odkshellapp:navGraph) not found.

The code we are working with open source and you can check it here: https://github.com/Samagra-Development/odk-collect-extension/tree/feature/library-publish-github-action.

We are working on checking this in-parallel but any help from you would be greatly appreciated.

@AndreasBoehm
Copy link
Author

Hie @AndreasBoehm thank you for trying to fix this.

We implemented the changes you mentioned but are getting the following errors:

> Task :sample:processDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml","position":{"startLine":20}}],"original":"ERROR:/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml:21: AAPT: error: attribute navGraph (aka com.example.odkshellapp:navGraph) not found.\n    ","tool":"AAPT"}
....

Execution failed for task ':sample:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:/.../extension/build/intermediates/packaged_res/debug/layout/entities_layout.xml:21: AAPT: error: attribute navGraph (aka com.example.odkshellapp:navGraph) not found.

The code we are working with open source and you can check it here: Samagra-Development/odk-collect-extension@feature/library-publish-github-action.

We are working on checking this in-parallel but any help from you would be greatly appreciated.

Hi @karntrehan,

I saw that you are using the DSL plugins { } to apply the fat-aar plugin without having defined pluginManagement in your settings.gradle file.
This means that you are still using the official fat-aar library. See here: https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories

You can either add pluginManagement or use the plugin version that you specified with classpath using the following line apply plugin: 'com.kezong.fat-aar'.

Best,
Andi

@PopFisher
Copy link

Still not effective, the configuration is as follows(AGP: 7.4.0 gradle:7.5)

root build.gradle
buildscript {
dependencies {
classpath 'com.github.kezong:fat-aar:1.3.8'
}
}

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

dependencies {
implementation("com.github.AndreasBoehm:fat-aar-android:da3ac00990")
embed("com.custom.aar")
}

I feel that I didn't use your change, where is the wrong?

@PopFisher
Copy link

The document is written wrong
dependencies {
classpath 'com.github.kezong:fat-aar:1.3.8'
}
Change to the following statement
dependencies {
classpath 'com.github.AndreasBoehm:fat-aar-android:da3ac00990'
}

@aasitnikov aasitnikov mentioned this pull request Jun 2, 2023
@osmanfilho
Copy link

any predictions for the merger to be carried out?

@AndreasBoehm
Copy link
Author

I don't think that this will ever get merged.

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.

None yet

7 participants