java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipRect(Canvas.java:826)
at com.airbnb.lottie.model.layer.CompositionLayer.b(CompositionLayer.java:97)
at com.airbnb.lottie.model.layer.BaseLayer.a(BaseLayer.java:187)
at com.airbnb.lottie.model.layer.CompositionLayer.b(CompositionLayer.java:93)
at com.airbnb.lottie.model.layer.BaseLayer.a(BaseLayer.java:187)
at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:338)
at android.widget.ImageView.onDraw(ImageView.java:1360)
报错代码:
canvas.clipRect(mClipBounds, Region.Op.UNION);
在项目中使用了一个三方的lottie,目前版本升级到2.7.0就好了
如果是在自己的项目中遇到解决办法:
if(Build.VERSION.SDK_INT >= 26){
canvas.clipRect(mClipBounds);
}else {
canvas.clipRect(mClipBounds, Region.Op.UNION);
}