ios Xcode 8 找不到此可执行文件的有效配置文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40290033/
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-08-31 10:39:18  来源:igfitidea点击:

Xcode 8 A valid provisioning profile for this executable was not found

iosxcodeprovisioning-profile

提问by Donald Hymanson

I know there are other questions asked like this here but I've followed all their solutions yet still end up with this error message.

我知道这里还有其他类似的问题,但我已经遵循了他们的所有解决方案,但最终仍然出现此错误消息。

  • 我有一个有效的 Apple Developer 帐户且程序处于活动状态。

  • 我曾尝试将托管和非托管配置与新的/新鲜的包 ID(获得重新创建的配置文件)一起使用。

  • 我试过这个:在调试模式下找不到此可执行文件的有效配置文件

  • 我试过这个:XCode:7 应用程序安装失败:找不到此可执行文件的有效配置文件

  • 我已从手机中删除了该应用程序的所有旧版本。

  • 我已确认我在开发人员门户上的设备 ID 与 Xcode 中的相同(对于手动配置配置文件管理进行确认也很有用)

  • 我什至出于极度绝望尝试了另一个开发人员 ID,但仍然出现相同的错误。

  • 在使用我的有效分发证书构建发布方案时,我什至收到此错误。

I've spent a ton of time trying to figure this out now I'm hoping someone else has felt my pain and actually solved this.

我花了很多时间试图解决这个问题,现在我希望其他人感受到我的痛苦并真正解决了这个问题。

UPDATE: Adding screenshots for usefulness

更新:添加有用的截图

UPDATE 2: I gave up trying to solve this problem, I created a new project and copied source files into the new project and I now have it working. Clearly something in the project configuration/settings files got corrupted somehow in the previous project which no obvious fix available. Will leave this question open, perhaps someone has a solution eventually. I have my old 'non-working' project so will continue to try those just for curiousities sake.

更新 2:我放弃了解决这个问题的尝试,我创建了一个新项目并将源文件复制到新项目中,现在我可以正常工作了。显然,项目配置/设置文件中的某些内容在上一个项目中以某种方式损坏,没有明显的修复可用。将这个问题悬而未决,也许最终有人会有解决方案。我有我的旧“非工作”项目,所以为了好奇,我会继续尝试那些项目。

Current Settings

当前设置

Before this error message, Build Succeededis shown.

在此错误消息之前,会显示Build Succeeded

Error Message

错误信息

Device ID - matches profiles

设备 ID - 匹配配置文件

List of profiles on device

设备上的配置文件列表

回答by Leo Lei

ATTENTION!

注意力!

Who should read

谁应该读

If you were developing with a "Personal Team"and is switchingto a paid team, then you'll get this error if you have not updated your other targets as well.

如果您正在使用“个人团队”进行开发并切换到付费团队,那么如果您还没有更新其他目标,则会出现此错误。

The cause

原因

Since I'm using react-native, I happen to have a target for test (i.e. a target called appTests), and switching the team just in one target wasn't sufficient, and leads to this error. This error isn't informative enough to let you know there's an error in one of the targets, therefore leading to a long debugging time for myself.

由于我使用的是 react-native,我碰巧有一个测试目标(即一个名为 appTests 的目标),并且仅在一个目标中切换团队是不够的,并导致此错误。此错误信息不足以让您知道其中一个目标中存在错误,因此导致我自己需要很长的调试时间。

Solution

解决方案

1) On Xcode 9, go to every targets and update the team!

1) 在 Xcode 9 上,转到每个目标并更新团队!

2) Unfortunately, the next steps aren't very reliable from my experience, you might have to do your best to clean the caches.

2) 不幸的是,根据我的经验,接下来的步骤不是很可靠,您可能必须尽力清理缓存。

3) Stop every single running scheme/application by using the stop button

3)使用停止按钮停止每个正在运行的方案/应用程序

4) Go to Product -> Clean and cleans every schemes you use.

4) 转到产品 -> 清理并清理您使用的每个方案。

5) Quit and Restart Xcode

5)退出并重新启动Xcode

6) Run again and hopefully it works! If not, it's likely some cache are still present.

6)再次运行,希望它有效!如果没有,则可能仍然存在一些缓存。

回答by wottle

You can't install a build that was signed with the app store distribution provisioning profile and certificate (I'm assuming your release scheme is set to use your app store cert and profile). It will fail to install on the device if you try. You need to use either a development profile, or an enterprise distribution profile to install on test devices. The iOS Distribution certificate can only be used to build an app that will be installed via the App Store.

您无法安装使用应用商店分发配置文件和证书签名的构建(我假设您的发布方案设置为使用您的应用商店证书和配置文件)。如果您尝试,它将无法在设备上安装。您需要使用开发配置文件或企业分发配置文件来安装在测试设备上。iOS 分发证书只能用于构建将通过 App Store 安装的应用程序。

回答by George Vardikos

Thats a conflict of Xcode. The way I solved it is by deleting the derived data of Xcode.

那是Xcode的冲突。我解决它的方法是删除Xcode的派生数据。

Xcode > Preferences > Locations

Xcode > 首选项 > 位置

You will see an arrow right from the path of the DerivedData which will open them in finder. Just erase everything in the folder.

您将在 DerivedData 的路径右侧看到一个箭头,它将在 finder 中打开它们。只需擦除文件夹中的所有内容。

Update:According to Chandler's comment check if there is a need to delete the test target.

更新:根据 Chandler 的评论检查是否需要删除测试目标。

回答by Vittal Pai

I solved it by changing the build system to legacy in Xcode 10

我通过在 Xcode 10 中将构建系统更改为旧版来解决它

File > Workspace Settings > Set Build system to "Legacy Build System"

File > Workspace Settings > Set Build system to "Legacy Build System"

回答by Feng Liu

It works when I also add the correct signing for myProjectTests. This was the last thing I did after trying all sort of solutions for 5 hours.

当我还为 myProjectTests 添加正确的签名时,它会起作用。这是我尝试了 5 个小时的各种解决方案后做的最后一件事。

回答by Alexander Vitanov

I followed many proposals but it didn't work until I unchecked Automatic signing for the TESTS

我跟很多建议,但它没有工作,直到我未选中自动签署的试验

回答by Lex

Clearing the DEVELOPMENT_TEAM and DevelopmentTeam entries in the xcodeproj/project.pbxproj file worked for me.

清除 xcodeproj/project.pbxproj 文件中的 DEVELOPMENT_TEAM 和 DevelopmentTeam 条目对我有用。

回答by Boostmachines

I'm on 8.2.1 and just had this same error. Deleting the original project folder and recreating it worked seamlessly. I verified that all of the signing and provisioning certificates were exactly the same as the last project. I'm not sure where the issue lies, but I believe your assumption of corrupted files is accurate.

我在 8.2.1 上,只是遇到了同样的错误。删除原始项目文件夹并重新创建它可以无缝地工作。我验证了所有签名和配置证书都与上一个项目完全相同。我不确定问题出在哪里,但我相信您对文件损坏的假设是准确的。

回答by Andrea Sessa

In my case it was a conflict with the development team.

就我而言,这是与开发团队的冲突。

I've solved by opening my xcodeproj/project.pbxproj and emptying the following variables:

我已经通过打开我的 xcodeproj/project.pbxproj 并清空以下变量来解决:

DevelopmentTeam
DEVELOPMENT_TEAM

回答by Frédéric Adda

We had a similar issue: we deleted the Unit Tests and it worked.

我们有一个类似的问题:我们删除了单元测试并且它起作用了。