ios Xcode:“此时无法安装此应用程序。”

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

Xcode: "This app could not be installed at this time."

iosxcodeios11xcode9.2

提问by JoakimSjo

Working with my first application for learning purposes. It goes well but has met into a problem with Xcode. When I try to run the application on the iPhone simulator this message always pops up "This app could not be installed at this time."

使用我的第一个应用程序进行学习。一切顺利,但遇到了 Xcode 的问题。当我尝试在 iPhone 模拟器上运行该应用程序时,总是会弹出此消息“此时无法安装此应用程序”。

screenshot

截屏

What is wrong? There are no errors when trying to build the app. Has tried to clean the build. Reinstall pods. Restarted Xcode. Erased all settings on the simulator device, however, the problems still exist.

怎么了?尝试构建应用程序时没有错误。已尝试清理构建。重新安装豆荚。重新启动Xcode。清除了模拟器设备上的所有设置,但问题仍然存在。

The error message does not give me any information. Is there another logfile I could look into or something?

错误消息没有给我任何信息。是否有另一个我可以查看的日志文件或其他内容?

回答by JoakimSjo

I managed to find the problem. The problem was that I had added some keys to a property list file that was not valid. I found the error by looking in the log file that was located here: ~/Library/Logs/CoreSimulator/

我设法找到了问题所在。问题是我向无效的属性列表文件添加了一些键。我通过查看位于此处的日志文件发现了错误:~/Library/Logs/CoreSimulator/

回答by raed

Reset the simulator:

重置模拟器:

Hardware-> Erase All content and settings...

Hardware-> Erase All content and settings...

Clean your project:

清理你的项目:

shift+cmd+K

shift+ cmd+K

shift+opt+cmd+K

shift+ opt+ cmd+K

This should fix your issue

这应该可以解决您的问题

回答by Emy Stats

I know the question has been answered but for others encountering the same issue I suggest following:

我知道这个问题已经得到解答,但对于遇到同样问题的其他人,我建议如下:

  • Check simulator logs, if its printing something useful. First, selecte simulator then from menu option open Debug-> Open System Logs.

  • Make sure only 1 simulator is running.

  • Delete the older version of app from the simulator.

  • If you importing a custom framework, make sure custom framework->bundle-id is not same as currentAppProject->bundle-id. If you are not sure then simply change the bundle-id of current project.

  • Also some of the simulators can be buggy -> Simply change the simulator, it may resolve the issue, for me changing the simulator worked.

  • 检查模拟器日志,如果它打印有用的东西。首先,选择模拟器,然后从菜单选项中打开Debug-> Open System Logs

  • 确保只有 1 个模拟器正在运行。

  • 从模拟器中删除旧版本的应用程序。

  • 如果您导入自定义框架,请确保自定义 framework->bundle-id 与 currentAppProject->bundle-id 不同。如果您不确定,那么只需更改当前项目的 bundle-id。

  • 还有一些模拟器可能有问题 -> 只需更改模拟器,它可能会解决问题,对我来说,更改模拟器有效。

回答by Antonioni

Found issue in ~/Library/Logs/CoreSimulator//MobileInstallation

在 ~/Library/Logs/CoreSimulator//MobileInstallation 中发现问题

WatchKit 2 app extension's NSExtension.NSExtensionAttributes.WKAppBundleIdentifier value does not match WatchKit app's bundle ID

WatchKit 2 应用扩展的 NSExtension.NSExtensionAttributes.WKAppBundleIdentifier 值与 WatchKit 应用的包 ID 不匹配

回答by Valentin Radu

For anybody wasting time on this obscure error. If you don't have any relevant logs and all the other answers fail, you might check if you recently added a framework that for some reason (didn't investigated why) can't be embedded, only linked. Happened to me with GoogleMaps for iOS.

对于任何在这个晦涩的错误上浪费时间的人。如果您没有任何相关日志并且所有其他答案都失败,您可能会检查您最近是否添加了一个框架,该框架由于某种原因(未调查原因)无法嵌入,只能链接。使用 iOS 版 GoogleMaps 发生在我身上。

回答by Sonam Maniar

I resolved this issue to remove DerivedDatafrom Xcode Preferences. and also Restartthe simulator from Hardware.

我解决了这个问题以从 Xcode 首选项中删除DerivedData。并从硬件重新启动模拟器。

回答by Aleksi Sj?berg

Changing the CFBundleShortVersionString in InfoPlist.stringsto match the one in info.plistfixed this for me. I had to use the simulator's "Erase All Content and Settings" after making this change.

更改InfoPlist.strings 中的 CFBundleShortVersionString以匹配info.plist中的一个为我解决了这个问题。进行此更改后,我必须使用模拟器的“擦除所有内容和设置”。

Trying to launch on a simulator with iOS 9.0 (instead of 11.2) gave this error instead, which helped me to find more answers on what's apparently the same issue:

尝试在带有 iOS 9.0(而不是 11.2)的模拟器上启动时出现了这个错误,这帮助我找到了更多关于明显相同问题的答案:

The operation couldn't be completed. (LaunchServicesError error 0.)

操作无法完成。(LaunchServicesError 错误 0。)

回答by lin

rm -rf ~/Library/Developer/Xcode/DerivedData/

回答by rustylepord

Occurred to me when I switched branches with another developer who was using a different version of CocoaPods , Deleting derived data folder worked !

当我与另一个使用不同版本 CocoaPods 的开发人员切换分支时发生在我身上,删除派生数据文件夹有效!

回答by CodeBender

I was seeing this on all simulators and all devices. Uninstalling the app would work once, but it continued to fail on me.

我在所有模拟器和所有设备上都看到了这一点。卸载该应用程序可以运行一次,但对我来说它继续失败。

The fix was to wipe out all my project's pods:

解决方法是清除我项目的所有 pod:

pod deintegrate

And then re-install again:

然后再次重新安装:

pod install

This was with XCode 9.3 and iOS 11.2/11.3.

这是使用 XCode 9.3 和 iOS 11.2/11.3。