Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[NativeAOT] [MetaData] on Application class missing from manifest

Abierto
#13,175 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@simonrozsival ya está trabajando en esto.

Desde el 20/10/2026.

  • #13210 de @simonrozsival — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, csharp

Línea de trabajo

Start with ComponentElementBuilder.cs, especially UpdateApplicationElement, which the issue identifies as copying application properties without writing component.MetaData. Compare the generated manifests for the repro with PublishAot=false and PublishAot=true; both Value and Resource metadata should appear on the Application class in the NativeAOT manifest.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Area: App+Library Build needs-triage
Android framework version

net11.0-android (Preview)

Affected platform version

.NET SDK 11.0.100-rc.2.26504.105

Description

While testing NativeAOT, I noticed that [MetaData] attributes on my Application class aren't included in the generated AndroidManifest.xml. The same attributes work with the default CoreCLR configuration.

This caused Google Maps to crash with “API key not found”, even though the key is declared on the Application class.

I've attached a small repro without any Google Maps dependency. Both Value and Resource metadata are affected. Metadata on an Activity, at assembly scope, or written directly in AndroidManifest.xml works.

I also tried CoreCLR with AndroidTypeMapImplementation=trimmable, which has the same problem.

It looks like UpdateApplicationElement copies the application properties but doesn't write component.MetaData:
https://github.com/dotnet/android/blob/801f9ecbab5118b13d21cb52409e507ad4b2feb7/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ComponentElementBuilder.cs#L238-L249

Steps to Reproduce
  1. Extract the ManifestMetadataRepro.zip into two separate folders.
  2. In the first folder, run:
    dotnet publish -c Release -r android-arm64 -p:PublishAot=false
    
  3. In the second folder, run:
    dotnet publish -c Release -r android-arm64 -p:PublishAot=true
    
  4. Compare obj/Release/net11.0-android/android-arm64/android/AndroidManifest.xml from both folders.

The CoreCLR manifest contains repro.application.value and repro.application.resource. Both are missing from the NativeAOT manifest, although both builds succeed.

Did you find any workaround?

Moving the attributes to assembly scope works:

[assembly: MetaData("repro.application.value", Value = "application-present")]
[assembly: MetaData("repro.application.resource", Resource = "@string/repro_value")]

Declaring the entries directly in AndroidManifest.xml also works.

Lenguaje dominante
C#
Estrellas
2.1k
Forks
581
Merge medio
1 d 17 h
PR fusionados (30 d)
249

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/android

Todos los issues de dotnet/android

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.