# PropertyReader.PropertyTypeMismatchException

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# PropertyTypeMismatchException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/inspector/PropertyReader.PropertyTypeMismatchException "View this page in Java")  

```
open class PropertyTypeMismatchException : RuntimeException
```

|---|---|---|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                                      |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                                                                       ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                                                                                  |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException.html#)                                                                                 ||
|   |   |   | ↳ | [android.view.inspector.PropertyReader.PropertyTypeMismatchException](https://developer.android.com/reference/kotlin/android/view/inspector/PropertyReader.PropertyTypeMismatchException#) |

Thrown if a client calls a typed read method for a property of a different type.

## Summary

|                                                                                                                                                                                                                                                                                                                             Public constructors                                                                                                                                                                                                                                                                                                                             ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [PropertyTypeMismatchException](https://developer.android.com/reference/kotlin/android/view/inspector/PropertyReader.PropertyTypeMismatchException#PropertyTypeMismatchException(kotlin.Int,%20kotlin.String,%20kotlin.String))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `expectedPropertyType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `actualPropertyType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` <br />                                                                                                                       |
| [PropertyTypeMismatchException](https://developer.android.com/reference/kotlin/android/view/inspector/PropertyReader.PropertyTypeMismatchException#PropertyTypeMismatchException(kotlin.Int,%20kotlin.String,%20kotlin.String,%20kotlin.String))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `expectedPropertyType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `actualPropertyType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `propertyName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` <br /> |

## Public constructors

### PropertyTypeMismatchException

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PropertyTypeMismatchException(
    id: Int, 
    expectedPropertyType: String, 
    actualPropertyType: String)
```

|                                                              Parameters                                                              ||
|------------------------|--------------------------------------------------------------------------------------------------------------|
| `expectedPropertyType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |
| `actualPropertyType`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

### PropertyTypeMismatchException

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PropertyTypeMismatchException(
    id: Int, 
    expectedPropertyType: String, 
    actualPropertyType: String, 
    propertyName: String?)
```

|                                                              Parameters                                                              ||
|------------------------|--------------------------------------------------------------------------------------------------------------|
| `expectedPropertyType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |
| `actualPropertyType`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |
| `propertyName`         | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`.   |