2015-06-18 4 views
7

Я просто установил бета-версию Xcode 7 и преобразовал мой проект Swift с инструкциями Swift 2.Xcode 7 beta - build error (xcassets)

Построить в порядке, но 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: Теперь, когда я пытаюсь запустить IOS Simulator из «открытых инструментов разработчика» меню из дока я достигаю эту ошибку:

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 

Я думаю, что это главный вопрос ...

+0

Перезагружен Xcode, iOS Simulator и Mac (при необходимости)? – LinusGeffarth

+0

@LinusG., Xcode был перезапущен несколько раз ... iOS симулятор не может быть перезапущен, потому что он не запускается ... ОК, теперь я попробую перезагрузить mac. – PhoeniX

+0

Да, если это не работает, попробуйте переустановить Xcode. Если у вас все еще есть .dmg, это не должно быть проблемой. – LinusGeffarth

ответ

8

Перейдите к ~/Library/Developer/CoreSimulator/Profiles/Runtimes, а затем удалите среду выполнения - время работы устарело. После, перезагрузки Xcode7 и запустить симулятор ...

Далее объяснение от @seancook:

I experienced this, too, on El Capitan. NIBs wouldn't load, no Sims present, and unable to launch Simulators through the Xcode/Open Developer Tool/Simulator menu. After fighting it for a few hours I've finally got it working.

Here's what worked for me (YMMV): I noticed a message in Console.app along the lines of the Simulator runtime not being code signed. I went to the path it described "/Library/Developer/CoreSimulator/Profiles/Runtimes" and removed the runtimes that I had there. They were old runtimes, so I assume that some check in Xcode now applies that didn't previously. Who knows?

After doing this, I could finally launch the Simulator via the Xcode/Open Developer Tool menu. Unfortunately, the Simulator still wasn't being shown as a run target in my workspace, so I kept spelunking...

I then went into the Simulator's Hardware/Devices/Manage Devices menu and added a new iOS9 device. It didn't seem to do anything, so I quit out of Xcode and Simulator.app. I then re-started Simulator.app (via Xcode/ODT/Simulator) and lo and behold the expected iOS9 simulators were displayed. I closed and re-opened Xcode, changed the target OS for my project, and the Sims were finally displayed as run targets.

+0

Это сработало для меня! Я предполагаю, что эта проблема возникла для меня после попытки удалить файлы из-за нехватки места. – hvaughan3

+0

Желание я мог бы изменить свой предыдущий комментарий, но я хотел упомянуть, что мне пришлось полностью перезагрузить свой компьютер после загрузки новых симуляторов в Xcode, чтобы что-то снова начало работать правильно. – hvaughan3

2

Я просто очистил полученные данные, и теперь он работает отлично.

5

Я использовал старый xCode (у меня есть 8.3.1, установленный appstore, и я использовал 8.2.1). Для меня решение было Xcode/Preferences> Locations и установка инструментов командной строки: Xcode 8.2.1 (8C1002) (раньше он был на новом Xcode)

Смежные вопросы