fat-aar-android icon indicating copy to clipboard operation
fat-aar-android copied to clipboard

fix missing resources when using AGP 7.3.X

Open AndreasBoehm opened this issue 3 years ago • 12 comments
trafficstars

Fixes

  • https://github.com/kezong/fat-aar-android/issues/402
  • https://github.com/kezong/fat-aar-android/issues/399

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

AndreasBoehm avatar Nov 15 '22 07:11 AndreasBoehm

Thanks for sharing this AndreasBoehm

BlueTurtle3 avatar Nov 15 '22 09:11 BlueTurtle3

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

tareq-threls avatar Nov 28 '22 11:11 tareq-threls

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

AndreasBoehm avatar Nov 30 '22 10:11 AndreasBoehm

Hi @AndreasBoehm could you please check this issue once https://github.com/kezong/fat-aar-android/issues/406

Hasan-rapido avatar Jan 02 '23 09:01 Hasan-rapido

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.

AndreasBoehm avatar Jan 04 '23 17:01 AndreasBoehm

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.

Hasan-rapido avatar Jan 05 '23 05:01 Hasan-rapido

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.

karntrehan avatar Mar 28 '23 10:03 karntrehan

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

AndreasBoehm avatar Mar 28 '23 12:03 AndreasBoehm

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 avatar Apr 03 '23 03:04 PopFisher

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' }

PopFisher avatar Apr 03 '23 04:04 PopFisher

any predictions for the merger to be carried out?

osmanfilho avatar Jun 12 '23 14:06 osmanfilho

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

AndreasBoehm avatar Jun 20 '23 07:06 AndreasBoehm