Android resource linking failed
from the CommonsWare Community archivesAt October 20, 2021, 2:30pm, Raptor asked:
So I have this error that is driving me crazy:
> Task :app:processProductionDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\myproject\\app\\build\\intermediates\\incremental\\mergeProductionDebugResources\\merged.dir\\values\\values.xml","position":{"startLine":7150}}],"original":"C:\\myproject\\app\\build\\intermediates\\incremental\\mergeProductionDebugResources\\merged.dir\\values\\values.xml:7151: AAPT: error: resource attr/description
This points to random attrs, like this:
<declare-styleable name="ProductDetailMFSItemView">
**<attr name="description"/>**
<attr name="value"/>
</declare-styleable>
I have no idea why it doesn’t work or how can I find more information on what’s going on. It’s driving me nuts. It’s also an older project that I haven’t opened in quite some time and now it throws errors like these.
At October 20, 2021, 7:11pm, mmurphy replied:
Since the error is coming from a file in build/
, have you cleaned the project? Old build/
artifacts might confuse newer build tools.
At October 21, 2021, 10:41am, Raptor replied:
I deleted the build folder and put the attributes in the root xml tag, now it says:
Execution failed for task ':app:mergeLibDexProductionDebug'.
> Could not resolve all files for configuration ':app:productionDebugRuntimeClasspath'.
> Failed to transform cameraview.aar (project :cameraview) to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-incremental-transform=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.usage=java-runtime}.
> Execution failed for AarToClassTransform:
At October 21, 2021, 11:56am, mmurphy replied:
Sorry, I have no real clue about that one. If cameraview
is a third-party library, confirm that you’re on a modern version of the library. If cameraview
is another module in your own project, can you build that module successfully on its own?
At October 21, 2021, 12:30pm, Raptor replied:
It seems to be both. I have another module in my project named “cameraview” AND a library.
The module (I think) is implemented like this:
api project(path: ':cameraview', configuration: 'default')
The library is this:
implementation 'com.otaliastudios:cameraview:2.0.0-beta04'
And yes, it’s a mess that I was forced into by… higher powers.
It now says:
> Could not resolve all files for configuration ':app:productionDebugRuntimeClasspath'.
> Failed to transform cameraview.aar (project :cameraview) to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-incremental-transform=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.usage=java-runtime}.
> Execution failed for AarToClassTransform: C:\AndroidProjects\project\cameraview\build\.transforms\4c15c0d9dc11026dbbf5fc750d89e609\jetified-cameraview-release.aar.
> C:\AndroidProjects\project\cameraview\build\.transforms\4c15c0d9dc11026dbbf5fc750d89e609\jetified-cameraview-release.aar
At October 21, 2021, 12:50pm, mmurphy replied:
My guess is that your errors from this post and the preceding one are referring to your modules, as both have (project :cameraview)
in the messages.
The jetified
in jetified-cameraview-release.aar
suggests that this module may be using older Android Support Library dependencies that are being converted on the fly into Jetpack library references. I don’t know if that is directly tied to whatever the root problem is, though.
I am sorry that I have not been of greater help on this!