繁体   English   中英

Xcode 7 beta - 构建错误(xcassets)

[英]Xcode 7 beta - build error (xcassets)

我只是安装Xcode 7 beta并使用Swift 2指南转换了我的Swift项目。

构建是可以的但是xcassets:我在日志中遇到了这个错误:

CompileAssetCatalog /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app {...}/Images.xcassets
cd /Users/phoenix/Dev/Xcode/{...}
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/usr/bin/actool --output-format human-readable-text\
    --notices --warnings --export-dependency-info /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_dependencies.txt
    --output-partial-info-plist /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_generated_info.plist\
    --app-icon AppIcon --launch-image LaunchImage --compress-pngs\
    --enable-on-demand-resources YES --target-device iphone --target-device ipad\
    --minimum-deployment-target 7.0 --platform iphoneos --compile\
    /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app\
    /Users/phoenix/Dev/Xcode/{...}/Images.xcassets
/Users/phoenix/Dev/Xcode/{...}/Images.xcassets: error:
    Failed to find a suitable device for the type SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 with runtime SimRuntime :
    9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0
Failure Reason: Failed to create new simulator device that matches SimDeviceType :
    com.apple.CoreSimulator.SimDeviceType.iPad-2 for runtime SimRuntime :
    9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 ((null))

UPD:现在,当我尝试从Dock中的“打开开发人员工具”菜单启动iOS模拟器时,我遇到此错误:

Dyld Error Message:
Library not loaded:
    @rpath/SimulatorKit.framework/Versions/A/SimulatorKit
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Conte‌​nts/MacOS/Simulator
Reason: image not found

UPD2:从终端尝试启动模拟器时收到警告:

$ Applications/Simulator.app/Contents/MacOS/Simulator 
dyld: warning, LC_RPATH @loader_path/../../../../Library/PrivateFrameworks in /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator being ignored in restricted program because of @loader_path
dyld: Library not loaded: @rpath/SimulatorKit.framework/Versions/A/SimulatorKit
  Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
  Reason: image not found

我认为这是一个主要问题......

导航到~/Library/Developer/CoreSimulator/Profiles/Runtimes ,然后删除运行时 - 运行时很旧。 之后,重启Xcode7,启动模拟器......

来自@seancook的进一步解释:

我也在El Capitan身上体验过这一点。 NIB不会加载,不会出现模拟人生,也无法通过Xcode / Open Developer Tool / Simulator菜单启动模拟器。 经过几个小时的战斗,我终于开始工作了。

这对我有用(YMMV):我注意到Console.app中的一条消息沿着Simulator运行时没有进行代码签名。 我去了它描述的路径“/ Library / Developer / CoreSimulator / Profiles / Runtimes”并删除了我在那里的运行时。 它们是旧的运行时,所以我假设现在应用Xcode中的一些检查以前没有。 谁知道?

完成此操作后,我终于可以通过Xcode / Open Developer Tool菜单启动模拟器。 不幸的是,模拟器仍然没有在我的工作区中显示为运行目标,所以我一直在探索......

然后我进入模拟器的硬件/设备/管理设备菜单并添加了一个新的iOS9设备。 它似乎没有做任何事情,所以我退出了Xcode和Simulator.app。 然后我重新启动了Simulator.app(通过Xcode / ODT / Simulator)并且看到了预期的iOS9模拟器。 我关闭并重新打开Xcode,为我的项目更改了目标操作系统,最终将Sims显示为运行目标。

我使用的是较旧的xCode(appstore安装了8.3.1,我使用的是8.2.1)。 对我来说,解决方案是Xcode / Preferences> Locations和设置命令行工具:Xcode 8.2.1(8C1002)(它之前是更新的Xcode)

我刚刚清除了派生数据,现在工作正常。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM