maven - Android Library Declare-Styleable Runtime Error -
maven - Android Library Declare-Styleable Runtime Error -
i have library widgets in maven central. when add together library dependency (from maven central) project using gradle, get:
java.lang.noclassdeffounderror: com.my.pacakge.r$styleable
if manually download .aar , include in project, works fine. tried using android studio's code completion see if library's r
included. when utilize maven dependency, typing com.my.pacakge.r
returns no results, when utilize local .aar returns r
library.
here's library code:
// widget constructor public foregroundimageview(context context, attributeset attrs) { super(context, attrs); typedarray = context.obtainstyledattributes(attrs, r.styleable.foregroundimageview); drawable foreground = a.getdrawable(r.styleable.foregroundimageview_android_foreground); if (foreground != null) { setforeground(foreground); } a.recycle(); } // attrs.xml <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="foregroundimageview"> <attr name="android:foreground"/> </declare-styleable> </resources>
the issue dependency getting published publishnondefault true
.
android maven android-gradle android-build aar
Comments
Post a Comment