从昨天开始,当我试图在我的设备上运行一个应用程序时,我一直得到以下错误:

未找到此可执行文件的有效配置文件。

这是在更新到Xcode 10之后。上周使用Xcode 9进行构建时没有出现问题。我已经检查了其他关于错误的讨论,但没有一个解决方案是有效的。

这个问题并不局限于我一直在做的一个项目,因为它影响了来自不同签约团队的几个人。

到目前为止,我尝试了以下方法:

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

该项目不包含测试,因此该目标上的签名设置错误不会出现问题。“日期/时间”设置为“自动”

值得注意的一点是,这里没有列出配置文件,除了我创建的手动配置文件:https://developer.apple.com/account/ios/profile/

我希望xcode生成一个显示,因为他们做的所有其他客户端。

下面是我目前正在使用的签名设置

我还没有尝试过将Xcode降级到旧版本,看看是否有效。除此之外,我不知道下一步该尝试什么。


当前回答

遇到同样的问题,我们在Xcode项目中有多个配置,让我们说调试-分期,调试-生产。然后我们统一这些配置,只使用一个配置Debug。但是旧的(不再存在)被卡在scheme for run阶段,所以一旦你试图运行,Xcode就会显示这条消息。这是有意义的,因为配置配置文件是在基于配置的构建设置中设置的。

运行方案是这样的:

而项目配置是这样设置的。

改变方案以使用项目中仍然可用的配置是为我解决这个问题的原因。

其他回答

以我为例,以下是我解决问题的步骤:

进入这个文件夹:~/Library/MobileDevice/Provisioning Profiles/ 删除所有配置文件 在Xcode 10菜单>产品>清洁构建文件夹 在Xcode 10菜单> Xcode >首选项>帐户>下载手动配置文件 在Xcode 10菜单> Product > Build / Archive

采取上述步骤的原因是为了删除打乱构建过程的旧配置配置文件。

对我们的团队来说,什么都没用。我们花了几天时间,尝试了上面回答和评论中提到的每一步。我们尝试了XCode 10,甚至XCode 9.2在应用程序上,这是在应用程序商店多年前。

该问题始于升级到MacOS Mojave后。不幸的是,回到HighSierra并没有什么帮助。

至少在我们创建了新的证书和配置文件后,我们能够再次将其发布到App store中。但我们仍然无法在真实设备上以发布模式测试我们的应用,这是测试inapp购买的必要条件。

简而言之:存档和提交工作得很好,在真正的设备上运行不行!

几个开发者,几个设备,macbook, XCode版本....

最后,为了能够再次在真实设备上进行测试,我们不得不改变AppID。

因此,我们现在运行两个不同的项目:一个是使用真正的AppID发布到TestFlight/AppStore,另一个是使用另一个AppID进行开发。

虽然这种情况只会发生在我们公司的一个特定应用上,而不是所有其他应用上,但我们预计未来会遇到类似的问题,因为苹果的开发工具会让情况变得更糟……

苹果似乎在Xcode 10.2 beta 2版本中修复了这个错误。

https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_beta_2_release_notes

Signing and Distribution Resolved Issues When you’re building an archive of a macOS app and using a Developer ID signing certificate, Xcode includes a secure timestamp in the archive’s signature. As a result, you can now submit an archived app to Apple’s notary service with xcrun altool without first needing to re-sign it with a timestamp. (44952627) When you’re building an archive of a macOS app, Xcode no longer injects the com.apple.security.get-task-allow entitlement into the app’s signature. As a result, you can now submit an archived app to Apple’s notary service using xcrun altool without first needing to strip this entitlement. (44952574) Fixed an issue that caused the distribution workflow to report inaccurate or missing information about the signing certificate, provisioning profile, and entitlements used when exporting or uploading an app. (45761196) Fixed an issue where thinned .ipa files weren’t being signed when exported from the Organizer. (45761101)

Xcode 10.2 beta 2 Release可以在这里下载: https://developer.apple.com/download/

好吧,似乎所有的答案中都没有提到我的案例。

我的应用程序是基于React Native。在这种情况下,确保勾选项目设置中的“常规”->“框架,库和嵌入式内容”。如果有嵌入式框架,“Embed”一栏应该是“Embed & Sign”。

在我厌倦了大部分的解决方案后,我发现它让它工作对我来说没有任何问题,它通过去developer.apple.com然后帐户,然后证书,标识符和配置文件解决,我点击设备下的所有链接,然后添加一个新设备。

然后您需要设置设备名称,和uuid,并保存后。 去xcode,清理缓存,构建,一切正常。

注1:确保你的团队是集真。

注2:你可以通过连接你的mac设备来获取uuid,点击iTunes,按安全标签,你会看到uuid。

这个答案也很有帮助。