I've got this error after switching from Jitpack to a self-hosted JFrog artifactory in order to build some android libraries (aar).
I have a baselib@aar
containing a custom view provided by a third-party library:
layout.xml:
<com.github.thirdparty.signature.views.CustomView
android:id="@+id/signature_pad"
android:layout_width="0dp"
android:layout_height="200dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:custom_attribute="@android:color/black" /> <--
implementation 'com.github.thirdparty:signature:1.0.0'
When I import it to my top level library it fail to compile giving me this error Android resource linking failed error
, with a link pointing to the layout.xml.
It's seems that the top lib can't resolve the custom_attribute
from the CustomView
when trying to parse the layout.xml.
This I've temporary solved by adding transitive = true
to my baselib
import
implementation ('com.mycompany.android:baselib:0.0.1-SNAPSHOT@aar'){
transitive = true
}
Now it compile.
But then I have two libraries using this baselib@aar
and my final app using those two libraries which give me new error:
Error: Program type already present
The only solution that I found for now is removing transitive = true
and import the third-party library containing the CustomView
to each libraries using the baselib
which I hope could be avoid.
First I'm wondering how Jitpack was compiling the aar in order to work. Any ideas?