xcode Xamarin Forms - 找不到配置文件(ios 包签名)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49620026/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:36:07  来源:igfitidea点击:

Xamarin Forms - Can't find provisioning profile (ios bundle signing)

xcodexamarinxamarin.formsxamarin.ios

提问by Grublet

I am using a macbook pro with visual studio community.

我正在使用带有 Visual Studio 社区的 macbook pro。

The error I receive in the console is:

我在控制台中收到的错误是:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(644,3): error : Could not find any available provisioning profiles for iOS.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(644,3): 错误:找不到任何可用的 iOS 配置文件。

I noticed that this error came up once we added the SecureStorage pluginto the project. Any commit prior doesn't result in this error.

我注意到一旦我们将SecureStorage 插件添加到项目中就会出现这个错误。之前的任何提交都不会导致此错误。

I have done the following:

我做了以下工作:

  • Opened up xCode >> Accounts >> Made sure my apple ID was there, downloaded the profiles manually. Also verified that my email address is correct in the description as well as my team (personal) was there too.
  • 打开 xCode >> Accounts >> 确保我的 Apple ID 在那里,手动下载配置文件。还验证了我的电子邮件地址在描述中是否正确以及我的团队(个人)也在那里。

Screenshot From description above

屏幕截图来自上面的描述

  • Gone into project.ios >> Info.Plist and checked that the bundle identifier and application name is correct. Screenshot from info.plist

  • Enabled KeyChain access: project.iOS >> Entitlements.plist >> KeyChain >> Enabled KeyChain ticked >> KeyChain Groups >> Added correct keychain

  • 进入 project.ios >> Info.Plist 并检查包标识符和应用程序名称是否正确。 info.plist 的截图

  • 启用 KeyChain 访问:project.iOS >> Entitlements.plist >> KeyChain >> Enabled KeyChain 勾选 >> KeyChain Groups >> 添加正确的钥匙串

KeyChain Enabled

钥匙串已启用

The problem is then:

那么问题来了:

Then when I go into project.ios >> Info.Plist >> ios Bundle Signing >>

然后当我进入 project.ios >> Info.Plist >> ios Bundle Signing >>

iOS Bundle Signing >> Provisioning Profile

iOS 捆绑签名 >> 配置文件

It can't see any matching profiles. See screenshot

它看不到任何匹配的配置文件。 看截图

Any help would be greatly appreciated, thanks!

任何帮助将不胜感激,谢谢!

回答by Grublet

This problem was tricky to solve for a few reasons:

由于以下几个原因,这个问题很难解决:

  1. It was only an issue when we introduced the localStorage plugin into the project, prior to that there was no issue. This was misleading.
  2. It was not clear that you had to make an xCode project and link it to your apple ID, this was the root of the problem.
  3. I am new to ios app development and xamarin.
  1. 只有我们在项目中引入localStorage插件时才出现问题,在此之前没有问题。这是误导。
  2. 不清楚您必须制作一个 xCode 项目并将其链接到您的 Apple ID,这是问题的根源。
  3. 我是 ios 应用程序开发和 xamarin 的新手。

Solution

解决方案

I did something similar to what's demonstrated here: https://www.youtube.com/watch?v=S9lNmnyACpY

我做了类似于这里演示的事情:https: //www.youtube.com/watch?v=S9lNmnyACpY

Open up xCode and create a new project (can also do this under the apple developer page) and create a new project with the same namespace (eg: xfPOC in my case) as your xamarin forms project.

打开 xCode 并创建一个新项目(也可以在苹果开发人员页面下执行此操作)并创建一个与 xamarin 表单项目具有相同命名空间(例如:xfPOC 在我的情况下)的新项目。

Copy the provisioning profile name it creates and then paste it into your "bundle identifier" in info.plist. From there, go into ios bundle signing and it should be able to find your provisioning profile.

复制它创建的配置文件名称,然后将其粘贴到 info.plist 中的“捆绑标识符”中。从那里,进入 ios 捆绑签名,它应该能够找到您的配置文件。

My aplogies to @SushiHangover who was actually correct, I originally replied to him saying that my bundle identifier did match my provisioning profile(which at the time didn't exist). By "provisioning profile", I thought that was set up at the beginning of the xamarin forms project as the organization Identifier, this is confusing because VS copies that into the bundle identifier in info.plist, which isn't particularly helpful because it looks like it's set everything up for you, whereas you need to go and create it yourself in xcode or on the apple development page. Personally, when I did that in my project, the provisioning profile did not match the default bundle identifier that VS created.

我向@SushiHangover 道歉,他实际上是正确的,我最初回复他说我的包标识符确实与我的配置文件匹配(当时不存在)。通过“配置文件”,我认为它是在 xamarin 表单项目的开头设置为组织标识符,这令人困惑,因为 VS 将其复制到 info.plist 中的包标识符中,这并不是特别有用,因为它看起来就像它为您设置了一切,而您需要自己在 xcode 或苹果开发页面上创建它。就我个人而言,当我在我的项目中这样做时,配置文件与 VS 创建的默认包标识符不匹配。