2015-06-18 35 views
7

Tôi vừa mới cài đặt Xcode 7 beta và chuyển đổi dự án Swift của mình với hướng dẫn Swift 2.Xcode 7 beta - lỗi xây dựng (xcassets)

xây dựng là OK nhưng xcassets: Tôi đạt được lỗi này trong nhật ký:

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: Bây giờ khi tôi cố gắng để khởi động iOS Simulator từ "công cụ phát triển mở" menu từ dock tôi đạt được lỗi này:

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: Khi cố gắng ra mắt mô phỏng từ thiết bị đầu cuối có cảnh báo:

$ 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 

Tôi nghĩ đây là vấn đề chính ...

+0

Xcode khởi động lại, iOS Simulator và Mac (nếu cần)? – LinusGeffarth

+0

@LinusG., Xcode đã được khởi động lại một số lần ... Trình mô phỏng iOS không thể khởi động lại được vì nó không khởi động ... OK, giờ tôi sẽ thử khởi động lại mac. – PhoeniX

+0

Yeah nếu điều đó không hoạt động, hãy thử cài đặt lại Xcode. Nếu bạn vẫn có .dmg thì đó không phải là vấn đề. – LinusGeffarth

Trả lời

8

Điều hướng đến ~/Library/Developer/CoreSimulator/Profiles/Runtimes, sau đó xóa thời gian chạy - thời gian chạy cũ. Sau đó, khởi động lại Xcode7, và khởi chạy Simulator ...

Tiếp tục giải thích từ @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

Điều này làm việc cho tôi! Tôi giả định vấn đề này bị cắt xén cho tôi sau khi cố gắng xóa các tệp sau khi hết dung lượng. – hvaughan3

+0

Ước gì tôi có thể chỉnh sửa bình luận trước đây của mình nhưng tôi muốn đề cập đến rằng tôi đã phải khởi động lại hoàn toàn máy tính của mình sau khi tải xuống thời gian chạy Mô phỏng mới trong Xcode để mọi thứ bắt đầu hoạt động chính xác trở lại. – hvaughan3

2

tôi chỉ xóa các dữ liệu thu được và nó hoạt động tốt ngay bây giờ.

5

Tôi đã sử dụng một xCode cũ hơn (tôi đã cài đặt 8.3.1 bởi appstore và tôi đang sử dụng 8.2.1). Đối với tôi, giải pháp là Xcode/Tùy chọn> Vị trí và cài đặt Công cụ Dòng lệnh: Xcode 8.2.1 (8C1002) (đã có trên Xcode mới hơn)

Các vấn đề liên quan