环境:
Windows 10家庭,21H2
VS 17.3.0预览1.1
为了达到这个错误,我遵循了以下步骤:
default
的项目配置文件
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>MauiApp1</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>MauiApp1</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.testapp.maui</ApplicationId>
<ApplicationIdGuid>CE4B9160-2B17-4559-8E4C-EA410A9A7966</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<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>
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
<CodesignKey>Apple Distribution: My Name (xxxxxxx)</CodesignKey>
<CodesignProvision>Apple Provisioning</CodesignProvision>
<ArchiveOnBuild>true</ArchiveOnBuild>
<TcpPort>58181</TcpPort>
<ServerAddress>xxxxx</ServerAddress>
<ServerUser>xxxxx</ServerUser>
<ServerPassword>xxxxx</ServerPassword>
<_DotNetRootRemoteDirectory>/Users/xxxxx/Library/Caches/Xamarin/XMA/SDKs/dotnet/</_DotNetRootRemoteDirectory>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
<BuildIpa>True</BuildIpa>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-ios|AnyCPU'">
<BuildIpa>True</BuildIpa>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>dotnet发布-f:net6.0-ios -c:Release
错误
iOS代码签名密钥'?Apple (xxxxxx)‘在密钥链中找不到。
必须启用
代码签名才能创建Xcode存档。
在此之前
根据这个https://www.youtube.com/watch?v=kpZi5xAvpZA和这个
中完成了所有必要的步骤
上的密钥链中安装了证书。
中安装了供应文件。
。
还请注意,错误'?Apple分发:我的名字(xxxxxx)‘中有一个问号,我不知道它是从哪里来的。
更新:
我在构建过程中使用这个命令创建了一个日志文件。
dotnet publish -f:net6.0-ios -c:Release /bl:msbuild.binlog可以使用以下工具查看日志文件:https://msbuildlog.com/
在这个日志文件中,错误消息没有有问号。因此,我想在编写日志消息时,问号只是一个显示错误。
然后,在binlog中,它字面上说:
证书'Apple : My (xxx)‘与'Apple : My (xxx)’不匹配。
我已经检查过人物的性格了。它完全是,是同一个字符串。
我还注意到,它确实从服务器下载了证书,因为我可以看到在"DetectingSigningIdentity“条目之后的binlog中列出的证书。
发布于 2022-05-31 23:22:22
我想通了,多亏了最后一条评论!
弦
<CodesignKey>Apple Distribution: My Name (xxx)</CodesignKey>
包含一个隐藏的字符。我不能在这篇文章中复制这个,因为隐藏的字符被过滤掉了。
但是它可以用字符串转换成十六进制转换器:https://online-toolz.com/tools/text-hex-convertor.php来再现。
输入这个十六进制代码: 3ee2808c,它将生成这个字符"<“。当您键入3e时,它将产生相同的字符"<“。问题是当复制/粘贴隐藏的字符与它一起出现时。
要证明这一点,您可以简单地将"<“从第一个产品复制/粘贴到工具中。
查找"e2808c“字符,它代表”零宽度非合并器“。
https://en.wikipedia.org/wiki/Zero-width_non-joiner
https://www.fileformat.info/info/unicode/char/200c/index.htm
我不知道这是怎么进到绳子里的。我也不知道字符串中有隐藏的字符!
因此,这些隐藏的字符串中的一个进入了我的CodesignKey标记,它将不再匹配。Visual用问号正确地指出了这一点。但是我对错误的理解是错误的,因为我没有预料到会有我看不到的东西.
https://stackoverflow.com/questions/72440792
复制相似问题