现象
开启混淆后shrinkResources true后,访问如下代码的textColor触发了空指针异常。
data class LyricStyleConfig(
/** 通用配置 */
@SerializedName("font") val font: String?,
@SerializedName("fontID") val fontId: Int?,
@SerializedName("textSize") val textSize: Int,
@SerializedName("textSpacing") val textSpacing: Int,
/** 第一行字相关配置 */
@SerializedName("textColor") val textColor: String?,
@SerializedName("shadowOffset") val shadowOffset: Float,
@SerializedName("shadowColor") val shadowColor: String?,
@SerializedName("shadowBlurRadius") val shadowBlurRadius: Float,
@SerializedName("strokeWidth") val strokeWidth: Float,
@SerializedName("strokeColor") val strokeColor: String?
)
异常信息
E/AndroidRuntime: FATAL EXCEPTION: GLThread 1777
Process: com.tencent.karaoke, PID: 13043
java.lang.NullPointerException: throw with null exception
at com.t