Custom view in local aar library unavailable?

I have a local aar file containing a custom View class (including res / values ​​/attrs.xml).

I know that local ars do not work by default, and I tried all the workarounds suggested here: How to manually enable an external aar package using the new Gradle Android Build System (Ran and Vipul answers).

However, none of these solutions seem to pick up a custom View class. By this, I mean that it does not appear in the Custom View section of the layout editor.

Should this work? Or are there any additional gradle -fu voodoo?

+5
source share
1 answer

Despite the fact that it is very old, I will give two cents for it.
In my case, I had a custom view that inherits the class RecyclerViewin the library project, but could not access it from the project's layout file.
It turned out that I needed to add a dependency of the type of recirculator (or com.android.support:design) to the Gradle project, even if it was included in the library.

0
source

Source: https://habr.com/ru/post/1541324/


All Articles