Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 977 Bytes

xa4258.md

File metadata and controls

25 lines (17 loc) · 977 Bytes
title .NET for Android error XA4258
description XA4258 error code
ms.date 08/07/2026
f1_keywords
XA4258

.NET for Android error XA4258

Example message

error XA4258: Java name 'com.example.for' contains reserved Java identifier 'for'. Change the package or type name.

Issue

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].

Solution

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.