Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Remove internal and orphaned error messages from localizable .resx resources

未关闭
#13,196 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp, xml

调研方向

Start by reading the referenced discussion in PR #13093, then trace the listed resource keys to their uses in the named task files and .targets file. Check each proposed removal against those call sites and remove orphaned entries from the specified .resx files. For mixed-use XA4234, preserve the user-facing MavenDownload diagnostic while handling internal invariant checks separately; done means the internal messages and unused entries are removed without losing user-facing diagnostics.

由索引模型根据 Issue 内容生成。

描述

needs-triage

Context: https://github.com/dotnet/android/pull/13093#discussion_r4314525729

Several error and warning messages stored in localizable .resx files are actually internal invariant/wiring checks — if they ever trigger, it indicates a bug in our MSBuild .targets, tasks, or SDK build outputs rather than something a user caused or can fix. Translating these adds unnecessary localization maintenance and can make internal bug reports harder to search and diagnose.

We should remove strictly internal error messages from localizable .resx resources (replacing them with non-localized exceptions or internal error messages) and clean up orphaned resource entries.


1. Strictly Internal Errors in src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Resource Key(s) Where Used Why It's an Internal Error
XA0116 CopyResource.cs Calls Assembly.GetExecutingAssembly().GetManifestResourceStream(ResourceName) to extract resources embedded inside Xamarin.Android.Build.Tasks.dll (MonoRuntimeProvider.Bundled.java, NativeAotRuntimeProvider.java, net.android.init.gradle.kts). Note that R8.cs already throws InvalidOperationException for missing embedded resources.
XA4219 GenerateLayoutBindings.cs Has a // Should "never" happen comment in the code. Unknown OutputLanguage values already fall back to DefaultOutputGenerator.Creator() (() => new CSharpBindingGenerator()), which is non-null.
XA4223, XA4224, XA4226 GenerateLayoutBindings.cs Validates metadata (LayoutGroup, WidgetCollectionKey, ClassName, etc.) on @(_LayoutForBinding) and @(_LayoutPartialClass) items created immediately beforehand by CalculateLayoutCodeBehind with hardcoded BaseNamespace="Binding".
XA4240 Xamarin.Android.Common.targets Validates the internal underscore-prefixed $(_AndroidJcwCodegenTarget) property (unlike XA4232, which validates the public $(AndroidCodegenTarget)).
XA4254, XA4255 GenerateTrimmableTypeMap.cs XA4254 checks that JavaSourceInputDirectory (obj/.../typemap/java) and JavaSourceOutputDirectory (obj/.../typemap/linked-java) differ — both are internal paths wired by .targets. XA4255 fires if a .java file expected from the pre-trim pass is missing in the post-trim pass.
XA4305 R8.cs Warns that $(_AndroidMainDexListFile) (MultiDexMainDexListFile) is empty when multidex is enabled; this is an internal property set to $(IntermediateOutputPath)multidex.keep.
XA4325 + all 14 XA4325_* sub-keys (_MappingNotFound, _MappingDataFailure, _AssemblyReadFailure, _AssemblyNotFound, _AssemblyHasNoMetadata, _AmbiguousEntry, _NativeAotObjectRequired, _NativeAotObjectReadFailure, _NativeAotModeRequired, _NativeAotObjectFormat, _NativeAotInvalidSection, _NativeAotTruncatedSection, _NativeAotMissingSections, _NativeAotInvalidDehydration) GenerateR8JniRemapping.cs, GenerateJniRemappingBinaryBlobs.cs, GenerateNativeAotDataObject.cs, NativeAotJniRetention.cs All validate internal task parameters (NativeAotObjectFile requires NativeAot=true), intermediate build outputs (r8-jni-mapping.txt, linked assemblies, post-ILC .o files), or internal ELF/NativeAOT dehydration invariants. (GenerateJniRemappingBinaryBlobs and GenerateNativeAotDataObject already pass unlocalized ex.Message into XA4325).
XA4327 ExtractTypeMapKeysFromAssemblies.cs, ExtractTypeMapKeysFromNativeAotObject.cs {1} already receives unlocalized internal exception strings ("No linked assemblies were supplied.", "An existing full path to llvm-readobj is required.", "The NativeAOT common-fixup table was not found."). Only triggers if our .targets pass bad inputs or our own TypeMapAttribute/ILC object format is out of sync with the parser.
XA4328, XA4328_NoInputs, XA4328_InvalidName GenerateTypeMapProguardConfiguration.cs Reads $(IntermediateOutputPath)typemap.keys.txt produced immediately before by _AndroidExtractTypeMapKeys. Missing input files or invalid lines in typemap.keys.txt indicate a bug in _AndroidExtractTypeMapKeys or .targets.
XA5303, XA5304 CompressAssemblies.cs XA5303 fails to parse DescriptorIndex metadata as uint, which CollectAssemblyFilesToCompress just formatted from uint.ToString(InvariantCulture). XA5304 validates CompressionLevel, which comes from internal $(_AndroidAssemblyStoreCompressionLevel).
XAGCA7009_UnsupportedRuntime GenerateNativeApplicationConfigSources.cs (#13093) Validates that GenerateNativeApplicationConfigSources is only invoked for the CoreCLR runtime.

2. Internal Errors in Other Resources.resx Files
  • Required_Downloadable_Mismatch (src/Xamarin.Installer.Build.Tasks/Properties/Resources.resx):
    • Literally reads: "Internal error: expected to install {0} components, but no downloads were available."
  • XA0135_RunAsPackageNotAndApplication (src/Xamarin.Android.Build.Debugging.Tasks/Properties/Resources.resx):
    • States: "The Fast Deployment system should have handled this particular error automatically and used a backup installation path. However if you are seeing this error please file an issue..."

3. Mixed Usage (User-Facing Code Reused for Internal Invariants)
  • XA4234 ('<{0}>' item '{1}' is missing required attribute '{2}'. via TryGetRequiredMetadata):
    • User-facing in MavenDownload.cs (<AndroidMavenLibrary> missing Version).
    • Also used for internal item metadata checks in CompressAssemblies.cs (AssembliesToCompress missing DestinationPath/DescriptorIndex), WrapAssemblyStoresAsSharedLibraries.cs (ResolvedAssemblies missing Abi), and BuildArchive.cs (FilesToAddToArchive missing ArchivePath).

4. Orphaned / Unused Entries in src/Xamarin.Android.Build.Tasks/Properties/Resources.resx

These keys have no remaining references in product code (several were internal errors from removed tasks/pipelines):

  • Internal/legacy typemap, marshal-methods & JCW codes: XA4217, XA4227, XA4253, XA4264, XA4305_File_Missing, XA4308, XA4324
  • Other unused codes: XA0105, XA0107_Ignoring, XA0118_Parse, XA0118_Target, XA0119_AAB, XA0122, XA0125, XA0139, XA1015, XA1016, XA1017, XA1019, XA2002_Framework, XA2002_NuGet, XA2006, XA2007, XA2008, XA2024, XA4209, XA4214, XA4214_Result, XA4231, XA4243, XA4300, XA4307, XA4311, XA5211, XA5300_Android_Platforms, XA5301
主要语言
C#
星标
2.1k
派生
579
平均合并
1 天 9 小时
30 天内合并 PR
220

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dotnet/android 的其他 Issue

查看 dotnet/android 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。