Caused by: java.lang.NoSuchMethodError: android.widget.FrameLayout.
at com.zaaach.alphamasklayout.AlphaMaskLayout.(AlphaMaskLayout.java:53)
at com.zaaach.alphamasklayout.AlphaMaskLayout.(AlphaMaskLayout.java:47)
at com.zaaach.alphamasklayout.AlphaMaskLayout.(AlphaMaskLayout.java:43)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
https://github.com/zaaach/AlphaMaskLayout/pull/3 问题出在
public AlphaMaskLayout(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
getAttrs(context, attrs);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public AlphaMaskLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
getAttrs(context, attrs);
}
在Android4.4手机上,构造方法不能够调用四个参数的构造方法。作者可以merge下我修改的部分