.NET 11 RC2 MAUI app fails to compile (NativeAOT) with MAUI Community Toolkit

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

维护者通常 1 天内回复

@simonrozsival 已经在做这个了。

开始于 2026年10月14日。

  • #13147 来自 @simonrozsival —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, csharp, java

调研方向

The failure is in the generated typemap file BoundServiceBinder.java under obj/Release/net11.0-android/typemap/java/, which references MediaControlsService from a package that is not generated. Linked pull request #13147 is already open against this work, so read it first and avoid duplicating it. Reproducing needs a NativeAOT Android publish of the MAUI Community Toolkit sample, which the issue does not provide. Done means the Android publish succeeds with NativeAOT on a clean build.

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

描述

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

net11.0-android (Preview)

Affected platform version

.NET 11 RC2

Description

The following exception occurs at build time (after clean bin/obj folders) when trying to publish an Android application with NativeAOT turned on. macOS/iOS build and run NativeAOT fine.

obj\Release\net11.0-android\typemap\java\scrc64243bbae2d1378c01\BoundServiceBinder.java:24: error: package scrc64d4e0e3a6d812f4d7 does not exist
    public BoundServiceBinder (scrc64d4e0e3a6d812f4d7.MediaControlsService p0)
                                                     ^
obj\Release\net11.0-android\typemap\java\scrc64243bbae2d1378c01\BoundServiceBinder.java:32: error: package scrc64d4e0e3a6d812f4d7 does not exist
    private native void nctor_2 (scrc64d4e0e3a6d812f4d7.MediaControlsService p0);
                                                       ^
2 errors
3 warnings
Steps to Reproduce

N/A - haven't tried to reproduce it

Did you find any workaround?

No

Relevant log output

主要语言
C#
星标
2.1k
派生
579
平均合并
1 天 17 小时
30 天内合并 PR
256

环境准备

  • 没有 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 摘要。