我下載了xCode 8.0 beta
並打開了一個最近寫入swift 2
的項目,然後我使用xCode將其轉換爲swift 3
。在Apple Watch Simulator(xCode 8,Swift 3,iOS 10)上的watchOS中運行SpriteKit遊戲 - libswiftSwiftOnoneSupport錯誤
我再補充一個watchOS
目標我的設置「遊戲」
文件>新建>目標項目:
我查了GameScene.swift在WatchExtension
果然所有的代碼在那裏,並設置一個場景:
import SpriteKit
class GameScene: SKScene {
private var spinnyNode : SKShapeNode?
override func sceneDidLoad() {
if let label = self.childNode(withName: "//helloLabel") as? SKLabelNode {
label.alpha = 0.0
label.run(SKAction.fadeIn(withDuration: 2.0))
}
let w = (self.size.width + self.size.height) * 0.05
let spinnyNode = SKShapeNode(rectOf: CGSize(width: w, height: w), cornerRadius: w * 0.3)
spinnyNode.position = CGPoint(x: 0.0, y: 0.0)
spinnyNode.strokeColor = UIColor.red()
spinnyNode.lineWidth = 8.0
spinnyNode.run(SKAction.sequence([SKAction.wait(forDuration: 0.5),
SKAction.fadeOut(withDuration: 0.5),
SKAction.removeFromParent()]))
spinnyNode.run(SKAction.repeatForever(SKAction.rotate(byAngle: 6.28, duration: 1)))
self.run(SKAction.repeatForever(SKAction.sequence([SKAction.wait(forDuration: 2.0),
SKAction.run({
let n = spinnyNode.copy() as! SKShapeNode
self.addChild(n)
})])))
}
override func update(_ currentTime: TimeInterval) {
// Called before each frame is rendered
}
}
不幸的是,我似乎無法得到這個安裝在Apple Watch模擬器上。
我用盡了一切我能想到的,包括:
- 清理構建等
- 卸載/重裝,
- 經過的info.plist for common errors,
- 創建一個新的模擬器配對Apple Watch使用
Add Additional Simulators
, - 新增Skip安裝=否,建議here,
- 從配對蘋果iOS應用程序觀看在iPhone模擬器(只是不安裝)安裝,
- 即使添加用戶定義的項目設置,如在raywenderlich watchOS教程建議...
我做不到讓它甚至可以安裝或出現在Apple Watch上。我沒做什麼?
UPDATE
我已經調整了部署目標至10.0 iOS應用程式,我終於能夠從iPhone模擬器的Apple關注的應用程序,安裝它除了在從啓動Apple關注應用蘋果手錶模擬器,我得到以下錯誤:
dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib
Referenced from: /Users/MYNAME/Library/Developer/CoreSimulator/Devices/XXXXXX-XXXX-XXXX-XXXX/data/Containers/Bundle/Application/XXXXXX-XXXX-XXXX-XXXX/MYAPPNAME.app/PlugIns/MYAPPWATCH Extension.appex/MYAPPWATCH Extension
Reason: image not found
(lldb)
這個錯誤是什麼意思?不應該有任何圖像加載,因爲它是默認的SpriteKit測試...
我在我的iMessage擴展應用程序中收到了dyld圖像錯誤,但「捆綁「沒有解決它。建議? –