ios Xcode 10:找不到此可执行文件的有效配置文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52424462/
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
Xcode 10: A valid provisioning profile for this executable was not found
提问by Daniel Andersson
Since yesterday I've been getting the following error when trying run an app on my device: "A valid provisioning profile for this executable was not found.". This is after updating to Xcode 10. Building with Xcode 9 last week worked without issues.
从昨天开始,当我尝试在我的设备上运行应用程序时,我一直收到以下错误:“找不到此可执行文件的有效配置文件。”。这是在更新到 Xcode 10 之后。上周使用 Xcode 9 构建没有问题。
I've checked the other discussions about the error, but none of the solutions works.
我已经检查了有关该错误的其他讨论,但没有一个解决方案有效。
The issue isn't limited to a single project I've been working on as it affects several all from different signing teams.
该问题不仅限于我一直在从事的单个项目,因为它会影响来自不同签约团队的多个项目。
So far I've tried the following:
到目前为止,我已经尝试了以下方法:
Cleaning project
Cleaning derived data
Uninstalling Xcode, deleting any preferences and files related to it.
Installing Xcode on a completely different Mac
Testing with different devices
Disabling device in developer profile and letting Xcode enable it again.
Deleting all certificates in the developer portal and recreating them
Unchecking and rechecking "Automatically manage signing"
Trashing the provisioning profile and letting Xcode recreate it
Creating a manual provisioning profile in the developer profile
清洁工程
清洗派生数据
卸载 Xcode,删除与之相关的所有首选项和文件。
在完全不同的 Mac 上安装 Xcode
使用不同设备进行测试
在开发人员配置文件中禁用设备并让 Xcode 再次启用它。
删除开发者门户中的所有证书并重新创建它们
取消选中并重新选中“自动管理签名”
删除配置文件并让 Xcode 重新创建它
在开发人员配置文件中创建手动配置文件
The project contains no tests so there can't be a problem with wrong signing settings on that target. Date / Time is set to Automatic
该项目不包含任何测试,因此该目标上的错误签名设置不会出现问题。日期/时间设置为自动
One thing of note is that no Provisioning Profiles are listed here, except for the manual one I created: https://developer.apple.com/account/ios/profile/
需要注意的一件事是这里没有列出任何配置文件,除了我创建的手册:https: //developer.apple.com/account/ios/profile/
I'd expect the xcode generated one to show up as they do for all other clients.
我希望 xcode 生成的一个像它们对所有其他客户端一样显示出来。
Below are the signing settings I'm currently using
以下是我目前使用的签名设置
I've yet to try downgrading Xcode to an older version to see if that works. Other than that I have no idea of what to try next.
我还没有尝试将 Xcode 降级到旧版本,看看它是否有效。除此之外,我不知道接下来要尝试什么。
回答by Stephen
I was struggling with this today, it was super frustrating. For now, just go into "File"
> "Project Settings..."
(or in some cases "Workspace Settings..."
) and then select "Legacy Build System"
from the "Build System"
dropdown.
我今天正在为此苦苦挣扎,这非常令人沮丧。现在,只需进入"File"
> "Project Settings..."
(或在某些情况下"Workspace Settings..."
),然后"Legacy Build System"
从"Build System"
下拉列表中进行选择。
回答by Vinícius Todesco
回答by Rickard Elim??
[edit] Note 2020: I used to manual sign this project. In projects where I automatically signed, I never had this issue. [/edit]
[编辑] 注意 2020:我曾经手动签署这个项目。在我自动签名的项目中,我从来没有遇到过这个问题。[/编辑]
I had the same problem, and spent hours searching for an answer, removing profiles, cleaning project, and so on.
我遇到了同样的问题,花了几个小时寻找答案、删除配置文件、清理项目等等。
Have you distributed your app? You need to switch back to your developer profile, but not in Generalunder the project settings, but in Build settings.
你分发了你的应用程序吗?您需要切换回您的开发人员配置文件,但不是在项目设置下的General中,而是在Build settings 中。
Under Signing, look at your Code Signing Identity.
在Signing 下,查看您的Code Signing Identity。
Make sure that both your Debug and Release are set your iOS Developer, and not iOS Distribution; or your iOS Developer Provisioning profile, if not set to the automatic values.
确保您的 Debug 和 Release 都设置为您的iOS Developer,而不是iOS Distribution;或您的 iOS Developer Provisioning 配置文件(如果未设置为自动值)。
The same goes with Provisioning Profile. It should be your developing profile, and not your distribution profile.
供应配置文件也是如此。它应该是您的开发配置文件,而不是您的分发配置文件。
Hope this will help future developers in need.
希望这将有助于未来有需要的开发人员。
回答by Chen
I have tried all the above solutions.
我已经尝试了上述所有解决方案。
However, in my case, after hours of headache it was because of the Test Projectdoes not have a valid account for provisioning the signing. After I selected a team to provision in the Test Projectwith automatic managed signing. This problem went away.
但是,就我而言,经过数小时的头痛,这是因为测试项目没有提供签名的有效帐户。在我选择一个团队在测试项目中提供自动管理签名之后。这个问题就迎刃而解了。
回答by Jerome Li
Use clean build folder (command + shift + K) and rebuild app can shortly fix this issue. However, the build time will increase since you have cleaned the build folder.
使用干净的构建文件夹(command + shift + K)并重建应用程序可以很快解决这个问题。但是,由于您清理了构建文件夹,构建时间会增加。
回答by Stewart Thomson
So this won't be the case for everyone but I thought I'd post it here anyway as there doesn't seem be any answers relating to it.
所以这不会是每个人的情况,但我想无论如何我都会在这里发布它,因为似乎没有任何与之相关的答案。
In my case I was working on an app that was being developed in ReactNative, my issue was that although my signing was correct on the main app target the test target did not have any signing applied to it.
For some reason React Native requires that both your app target and your test target are signed in order to install the app on a device.
It does specify this in the official documentation on building for devicehowever its the only instance I have ever seen where the test target is built alongside the app for anything other than testing.
就我而言,我正在开发一个在 ReactNative 中开发的应用程序,我的问题是,尽管我的签名在主应用程序目标上是正确的,但测试目标没有对其应用任何签名。
出于某种原因,React Native 要求您的应用程序目标和测试目标都进行签名,以便在设备上安装应用程序。
它确实在有关为设备构建的官方文档中指定了这一点,但是它是我见过的唯一一个实例,其中测试目标与应用程序一起构建,用于除测试之外的任何事情。
In order to sign your test target, go to your project settings by opening the project navigator (?1) and select your project at the top.
为了对您的测试目标进行签名,请通过打开项目导航器 (?1) 并在顶部选择您的项目来转到您的项目设置。
Inside the main editor select your main app target under Targets (should have the same name as your project) and ensure the signing is correct, then select the test target (likely just under your main app target, it should be the same name with Tests appended) and make sure its signed in the same way.
在主编辑器中,在 Targets 下选择您的主应用程序目标(应该与您的项目同名)并确保签名正确,然后选择测试目标(可能就在您的主应用程序目标下,它应该与 Tests 同名)附加)并确保以相同的方式签名。
Rebuild your app and it should now install successfully.
重建您的应用程序,它现在应该可以成功安装。
Credit for this goes to Leo Lei, his answer here saved me a lot of headache: https://stackoverflow.com/a/48657358/732844
这要归功于 Leo Lei,他在这里的回答让我很头疼:https: //stackoverflow.com/a/48657358/732844
As an aside, if anyone knows why react native requires your test target be built alongside your app target could they let me know? The only reason I can think of is to streamline the interface so react can build a single app and do both running and testing without needing to rebuild but i'm just guessing with that one.
顺便说一句,如果有人知道为什么 React Native 要求您的测试目标与您的应用程序目标一起构建,他们可以让我知道吗?我能想到的唯一原因是简化界面,以便 React 可以构建单个应用程序并在不需要重建的情况下运行和测试,但我只是在猜测那个。
回答by Raptor
In my case, here are the steps that I resolve the problems:
就我而言,以下是我解决问题的步骤:
- Go to this folder:
~/Library/MobileDevice/Provisioning Profiles/
- Remove all the provisioning profile
- In Xcode 10 menu > Product > Clean Build Folder
- In Xcode 10 menu > Xcode > Preferences > Account > Download Manual Profiles
- In Xcode 10 menu > Product > Build / Archive
- 转到此文件夹:
~/Library/MobileDevice/Provisioning Profiles/
- 删除所有配置文件
- 在 Xcode 10 菜单 > 产品 > 清理构建文件夹
- 在 Xcode 10 菜单 > Xcode > Preferences > Account > Download Manual Profiles
- 在 Xcode 10 菜单 > 产品 > 构建/存档
The reason to take the steps above is to remove the old provisioning profiles that messed up the building process.
采取上述步骤的原因是删除使构建过程混乱的旧配置文件。
回答by delete
For our team, nothing helped. We have spend a couple of days and tried out every step that was mentioned here above in answers and comments. We tried with XCode 10 and even XCode 9.2 on an App, that is on the App store since many years.
对于我们的团队来说,没有任何帮助。我们花了几天时间尝试了上面在答案和评论中提到的每一步。我们在应用程序上尝试使用 XCode 10 甚至 XCode 9.2,该应用程序已在应用程序商店中存在多年。
The issue began after upgrading to MacOS Mojave. Unfortunately, going back to HighSierra didn't help then.
升级到 MacOS Mojave 后问题开始出现。不幸的是,回到 HighSierra 并没有帮助。
At least we was able again to ship into App store after we've created new certificate and provisioning profile. But we still are not able any more to test our App in release mode on real device, which is necessary to test InApp-purchases.
至少在我们创建了新的证书和配置文件后,我们能够再次发布到 App Store。但是我们仍然无法在真实设备上以发布模式测试我们的应用程序,这是测试应用程序内购买所必需的。
In short: Archiving and submission works well, running on real device not!
简而言之:存档和提交效果很好,不能在真实设备上运行!
Several developers, several devices, macbooks, XCode versions....
几个开发人员,几个设备,macbook,XCode 版本......
At the end we had to change the AppIDfor being able again to test on real device.
最后,我们不得不更改 AppID,以便能够再次在真实设备上进行测试。
Therefor we run two different projects now: one for shipping to TestFlight/AppStore with the real AppID and one for development purposes with another AppID.
因此,我们现在运行两个不同的项目:一个用于使用真实 AppID 运送到 TestFlight/AppStore,另一个用于开发目的使用另一个 AppID。
Although this only happens on ONE particular App of our company and not all the others, we expect to run into similar issues in the future as things get more worse with Apple's development tools...
虽然这只发生在我们公司的一个特定应用程序上,而不是所有其他应用程序上,但我们预计将来会遇到类似的问题,因为 Apple 的开发工具使事情变得更糟......
回答by David Mayes
I had this issue occurring in Xcode 10.3 after I switched over to my XCTest unit test target then back to the project run time target.
在切换到 XCTest 单元测试目标然后返回到项目运行时目标后,我在 Xcode 10.3 中出现了这个问题。
Turns out I had a different Teams selected in my provisioning profile for each target.
结果我在我的配置文件中为每个目标选择了不同的团队。
To fix it :
要解决这个问题 :
- Clean Build Folder
- Make sure all may targets are using the same Team. See Profile Signing under the general tab.
If not using same Team for all targets, clean before switching to a build target with
different team selected.
- 清理构建文件夹
- 确保所有可能的目标都使用同一个团队。请参阅常规选项卡下的配置文件签名。
如果没有对所有目标使用相同的团队,请在切换到构建目标之前进行清理
选择了不同的团队。
回答by Rewieer
Make sure the provisionning profile comes from the same teamin both your target and your targetTests.
确保配置文件来自您的目标和 targetTests 中的同一团队。