i get this error on some devices but on others everything works.
Caused by java.lang.ClassNotFoundException Didn't find class "android.widget.Magnifier$Builder" on path: DexPathList[[zip file "/data/app/android.myproject-y_q4TlFhfWP/base.apk"], nativeLibraryDirectories=[/data/app/android.myproject-y_q4TlFhfWP/lib/arm64, /data/app/android.myproject-y_q4TlFhfWPN/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
I use custom view, crashes on initialization Magnifier
class CustomView : FrameLayout {
private var magnifier: Magnifier? = null
constructor(context: Context) : super(context) {
init(context)
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
init(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
) {
init(context)
}
private fun init(context: Context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
var magnifier = Magnifier.Builder(this)
.setInitialZoom(2f)
.build()
}
}