[NativeAOT] [MetaData] on Application class missing from manifest
Los mantenedores suelen responder en 1 día
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
- Área
- build-system, mobile
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
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
- Extract the ManifestMetadataRepro.zip into two separate folders.
- In the first folder, run:
dotnet publish -c Release -r android-arm64 -p:PublishAot=false - In the second folder, run:
dotnet publish -c Release -r android-arm64 -p:PublishAot=true - Compare
obj/Release/net11.0-android/android-arm64/android/AndroidManifest.xmlfrom 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/android
-
Area: App+Library Build
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
EditText.getText() isn't boundAbiertoArea: Mono.Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/android#9192 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
agentic-workflows needs-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Automatically include NativeAOT debug symbols in Android App Bundles for Google PlayPosiblemente ocupada @simonrozsival la tomó hace 1 día. AbiertoArea: App+Library Build needs-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
.NET11 RC2 AndroidTypeMapImplementation trimmable doesn't generate java callable wrappers for classes marked with Register attributePosiblemente ocupada @simonrozsival la tomó hace 1 día. Abiertoneeds-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 46/100
dotnet/android#13205 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/android
Issues similares
-
bug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CodeForFire/lagebuch#714 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dimitar-radenkov/Pointframe#294 ·
Los mantenedores suelen responder en 1 día
-
Batteries can't be swappedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
Okabintaro/SubmersedVR#253 ·
-
S: Untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 2 días
-
Remove Extract Data capabilitiesAbiertomaintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
hyjinx-emu/Hyjinx#398 ·
Los mantenedores suelen responder en 1 día