Maui Android运行时标识符和SelfContainered



我对此感到非常困惑,尝试我在这里搜索的不同解决方案,但都不起作用。我一周前发布了第一个apk版本,但当我今天运行visualstudio时,它还没有构建。

每次我构建应用程序输出时,都会给出->quotNETSDK1031不支持在不指定RuntimeIdentifier的情况下构建或发布自包含的应用程序。必须指定RuntimeIdentifier或将SelfContainerd设置为false";

如果有人能解释我,了解发生了什么,请感激。

我的.csproj

<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-maccatalyst;net6.0-android31.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>AppRipsaPagosMAUI</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- App Identifier -->
<ApplicationId>com.companyname.appripsapagosmaui</ApplicationId>
<ApplicationIdGuid>61252DD6-68C5-4051-9E5F-30226AFF9A7E</ApplicationIdGuid>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

请尝试将<TargetFrameworks>标记中的net6.0-android31.0更改为net6.0-android。并删除binobj文件夹,使用包管理器控制台和maui检查库清理+重建+maui检查

最新更新