Xcode 8 App 安装失败,发生未知错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41119893/
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 8 App installation failed, unknown error occured
提问by Chan Jing Hong
The following error occurred when I tried to run a project on my iOS device. Running it on a simulator works fine.
当我尝试在 iOS 设备上运行项目时发生以下错误。在模拟器上运行它工作正常。
The other weird thing is that I am able to run my other projects on my device, only this particular project that is giving me this error.
另一个奇怪的事情是我能够在我的设备上运行我的其他项目,只有这个特定的项目给了我这个错误。
I tried all the solutions I'm able to find:
我尝试了我能找到的所有解决方案:
- Cleaning the project, deleting derived data
- Restarting Xcode, my Mac, and my iOS device
- Deselect 'Automatically manage signing' in the testing Target.
- I couldn't delete the app from my device and re-install it because it wasn't installed on my device before.
- 清理项目,删除派生数据
- 重新启动 Xcode、我的 Mac 和我的 iOS 设备
- 在测试目标中取消选择“自动管理签名”。
- 我无法从我的设备中删除该应用程序并重新安装它,因为它之前没有安装在我的设备上。
Any help would mean alot to me! I am using Xcode 8.1 with Swift 3.0, running on a iOS 10.1.1 device.
任何帮助对我来说意义重大!我使用 Xcode 8.1 和 Swift 3.0,在 iOS 10.1.1 设备上运行。
回答by Thiha Aung
- Close your Xcode completely from currently running on Dock
- Unplug your iDevices cable at your Mac and plug again.
- Open Xcode Again.
- Clean,Build and Wait for indexing the device
- Delete the previous app you install on your iDevice
- Then install
- 完全关闭当前在 Dock 上运行的 Xcode
- 在 Mac 上拔下 iDevices 电缆并重新插入。
- 再次打开Xcode。
- 清理、构建并等待索引设备
- 删除您之前在 iDevice 上安装的应用程序
- 然后安装
If you have free Developer ID, make sure you got the Internet accessright on your iDevices.
如果您有免费的 Developer ID,请确保您的 iDevices能够正确访问 Internet 。
Else,
别的,
- Check your provision profile or certificates of your app that it's still available or not [Expire or not].
- If expired, please create again.
- Install those latest provision profile at your Xcode
Preferences/Account/Detail/
- Make sure Signing "Debug" and "Release" aren't empty
- Close the Xcode(Completely quit from Dock) after you completed those steps
- Open the Xcode again and do Clean,Build and Install
- 检查您的应用程序的配置文件或证书,它是否仍然可用[是否过期]。
- 如果过期,请重新创建。
- 在你的 Xcode 上安装那些最新的配置文件
Preferences/Account/Detail/
- 确保签名“调试”和“发布”不为空
- 完成这些步骤后关闭 Xcode(完全退出 Dock)
- 再次打开 Xcode 并执行 Clean、Build 和 Install
Hope this help.
希望这有帮助。
Other alternative way,
其他替代方式,
- Remove the app on the device and re-install
- Change build version no and install again
- 删除设备上的应用程序并重新安装
- 更改构建版本号并重新安装
回答by Vaibhav Thakre
Clean your the project and reattach your device
清理您的项目并重新连接您的设备
回答by Alpana
Do a pod update if you are using CocoaPods. This error can occur due to one of the pod libraries, device logs can be checked for the name of the library.
如果您使用 CocoaPods,请进行 pod 更新。由于 pod 库之一,可能会发生此错误,可以检查设备日志中的库名称。
回答by Frost
I get this error only on the second compile for device targets, and I've found that if I just modify one critical source code file by adding just an empty line, the error goes away and Xcode will compile again. The other way is to target a second device which isn't always convenient. A way around this confusion is to add a an Xcode Run Script that basically does this for you.
我只在第二次编译设备目标时遇到这个错误,我发现如果我只是通过添加一个空行来修改一个关键的源代码文件,错误就会消失,Xcode 将再次编译。另一种方法是定位第二个设备,这并不总是很方便。解决这种混淆的一种方法是添加一个 Xcode 运行脚本,它基本上可以为您执行此操作。
Force Xcode 9 to recompile after a build seems to be file dependent also
构建后强制 Xcode 9 重新编译似乎也依赖于文件
touch ${SRCROOT}/MyProject/MySourceFile.swift exit $? With the above script my issues went away, and I never saw the Xcode Alert again. This bug has been in several iterations of Xcode now.
触摸 ${SRCROOT}/MyProject/MySourceFile.swift 退出 $? 使用上面的脚本,我的问题消失了,我再也没有看到 Xcode Alert。这个错误现在已经出现在 Xcode 的几次迭代中。
回答by Lewis Edward Garrett
This error message occurred when I was building on an iPhone 5 and an iPhone 6 Plus with Xcode 10. Build in iPhone 5s Simulator gave a different error: "App could not be installed at this time…/Notification Extension: No such file or directory"
当我使用 Xcode 10 在 iPhone 5 和 iPhone 6 Plus 上构建时出现此错误消息。在 iPhone 5s Simulator 中构建给出了不同的错误:“此时无法安装应用程序.../通知扩展:没有这样的文件或目录”
Problem was resolved by check marking Target Membership in my Notification Extension's source file.
问题已通过在我的通知扩展的源文件中选中标记目标成员来解决。
回答by Gaurav Chandarana
It can happen if you have debugged the same app(bundle identifier) with more than one Apple Ids. Remove all accounts from Xcode and sign in to the one which you're currently working with.
如果您使用多个 Apple Id 调试同一个应用程序(捆绑标识符),就会发生这种情况。从 Xcode 中删除所有帐户并登录到您当前使用的帐户。
回答by ioio007
I have the same problem too, and also tried all the solution like you. unfortunately, not solve this problem, but I copied my project to another path, the copied one can build on my phone successfully, hope this can help you.
我也有同样的问题,也像你一样尝试了所有的解决方案。不幸的是,没有解决这个问题,但我将我的项目复制到另一个路径,复制的可以成功构建在我的手机上,希望这可以帮助你。
回答by Test iOS
- Restart your Xcode & Uninstall your app.
- Build & Clean your Project, now it working good. this works for me
- 重新启动您的 Xcode 并卸载您的应用程序。
- 构建并清理您的项目,现在它运行良好。这对我有用
above is not working please Restart your system
以上无效请重新启动系统