0
votes

I have a simple Swift class that works fine in the XCode 8.1 project it was created with (there is more in the class but the example was cut down for brevity).

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.....")
   }
}

And is used in in viewDidLoad()

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

I created new Hyperloop iOS project (SDK 5.5.1.GA) and added this into a src dir along with an associated appc.js. But every time the app compiles I get as far as the Hyperloop compile and it fails with the following

[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

So I then tried adding this file into the src directory of the hyperloop-examples project, but this also give me the following error

[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

What am I doing wrong and any suggestions on how to correct the issue?

1

1 Answers

0
votes

Have you added the AVFoundation framework to the appc.js file?