# android.view.InflateException: Binary XML file line #XX: Error inflating class <unknown>

- **ID:** `android/layout-inflater-crash-bad-parameter`
- **Domain:** android
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A layout XML file contains an invalid attribute, missing custom view, or incompatible resource reference that prevents inflation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Android 10 (API 29) | active | — | — |
| Android 11 (API 30) | active | — | — |
| Android 12 (API 31) | active | — | — |
| Android 13 (API 33) | active | — | — |

## Workarounds

1. **Inspect the layout XML file at the line number indicated in the error. Look for typos in attribute names, missing namespace declarations (e.g., xmlns:app), or incorrect custom view class names. Example: replace 'android:backgroundTint' with 'app:backgroundTint' if using appcompat.** (90% success)
   ```
   Inspect the layout XML file at the line number indicated in the error. Look for typos in attribute names, missing namespace declarations (e.g., xmlns:app), or incorrect custom view class names. Example: replace 'android:backgroundTint' with 'app:backgroundTint' if using appcompat.
   ```
2. **Ensure all custom views are properly declared in the XML with their fully qualified class name (e.g., com.example.MyCustomView instead of MyCustomView).** (85% success)
   ```
   Ensure all custom views are properly declared in the XML with their fully qualified class name (e.g., com.example.MyCustomView instead of MyCustomView).
   ```
3. **If using a custom view from a library, verify the library is added as a dependency in build.gradle and the view is not conditionally loaded.** (80% success)
   ```
   If using a custom view from a library, verify the library is added as a dependency in build.gradle and the view is not conditionally loaded.
   ```

## Dead Ends

- **** — The error is in the code, not runtime cache; clearing cache doesn't fix invalid XML. (90% fail)
- **** — Reinstallation doesn't change the source code; the same invalid XML will be inflated again. (95% fail)
