When using Kotlin, a member variable is encountered and an error is reported Accidental override

First post the error location
insert image description hereAccidental override: The following declarations have the same JVM signature (getMatrix()Landroid/graphics/Matrix;):

The reason for the error here is that kotlin sets the get/set method for member variables by default, which leads to the same name as the original getMatrix() method of the class. The solution is also very simple, which is to modify the member variable name (matrix -> mMatrix) .
insert image description here

Guess you like

Origin blog.csdn.net/xlk_1996/article/details/127239861