[NativeAOT] [MetaData] on Application class missing from manifest
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 66/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, csharp
- 領域
- build-system, mobile
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C#
- スター
- 2.1k
- フォーク
- 581
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 228
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/android のほかの issue
-
Area: App+Library Build
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Area: Mono.Android
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
dotnet/android#9192 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Area: Mono.Android needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
Area: App Runtime needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
flaky-ci flaky-tests needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug priority: P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged dotnet-csharp/svc fundamentals/subsvc
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Wrong values of Kernel32.FileShare.Delete and Kernel32.FileAttributes.PosixSemantics対応中かも @ElectLive が今日担当しました。 オープンbug good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
ForNeVeR/TruePath#241 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
files-community/Files#19047 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信