| title | .NET for Android error XA4258 | |
|---|---|---|
| description | XA4258 error code | |
| ms.date | 08/07/2026 | |
| f1_keywords |
|
error XA4258: Java name 'com.example.for' contains reserved Java identifier 'for'. Change the package or type name.
A Java package or type name contains a Java keyword or restricted type identifier. Java does not provide a way to escape keywords. Restricted type identifiers are also rejected to keep generated Java source compatible when .NET for Android moves to a newer Java source level.
This can originate from the $(ApplicationId) MSBuild property, the package attribute in AndroidManifest.xml, a managed type name, or an explicit Java name supplied by an attribute such as [Register] or [JniTypeSignature].
Change the package or type name so no segment is a Java keyword. For a type name, also avoid restricted type identifiers such as record.