2016-10-30 40 views
0

我有一個簡單的Swift類,在它創建的XCode 8.1項目中工作正常(類中有更多,但爲簡潔起見,此示例被減少)。Hyperloop Swift生成失敗,出現未知或不支持的類型(AVCaptureSession)

import UIKit 
import AVFoundation 

public class ExampleView: UIView { 

    let captureSession = AVCaptureSession() 
    var previewLayer : AVCaptureVideoPreviewLayer? 

    override init (frame : CGRect) { 
     super.init(frame : frame) 
    } 

    convenience init() { 
     self.init(frame:CGRect.zero) 
    } 

    required public init(coder aDecoder: NSCoder) { 
     fatalError("This class does not support NSCoding") 
    } 

    func doSomething(){ 
     print("do something here.....") 
    } 
} 

,並用於在viewDidLoad中()

let example = ExampleView(frame: self.view.layer.frame); 
example.doSomething() 

我創造了新的超迴路列車的iOS項目(SDK 5.5.1.GA),並加入到一個src目錄與此相關的appc.js沿。但是,每一個應用程序編譯時,我得到儘可能的超迴路列車編譯和它失敗,出現以下

[TRACE] : [Hyperloop] metabase took 2243 ms to generate 
2016-10-30T15:39:31.675Z | ERROR | An uncaught exception was thrown! 
Cannot read property '1' of null 
2016-10-30T15:39:31.676Z | ERROR | Cannot read property '1' of null 

所以我再嘗試添加該文件到SRC目錄的超迴路列車-例子項目,但這也給我以下錯誤

[TRACE] : [Hyperloop] metabase took 2425 ms to generate 
Swift Generation failed with unknown or unsupported type (AVCaptureSession)  found while compiling /Users/accountone/hyperloop-examples/src/MyExample.swift 

我在做什麼錯誤和任何建議如何糾正問題?

回答

0

您是否將AVFoundation框架添加到appc.js文件?

+0

我沒有作爲例子appc.js指出Hyperloop將確定所需的框架,但我現在已將它添加到framworks列表中。但我仍然得到同樣的錯誤。 – Steve

相關問題