Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Remove internal and orphaned error messages from localizable .resx resources

Đang mở
#13,196 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, xml

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C#
Star
2.1k
Fork
581
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
249

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/android

Tất cả issue của dotnet/android

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.