2016-10-09 55 views
-1

我按照http://moduscreate.com/writing-a-cordova-plugin-in-swift-for-ios/的說明生成一個基於Swift的Cordova插件。Swift科爾多瓦橋undefined錯誤

當我得到儘可能通過命令「科爾多瓦平臺添加IOS」我期待類似的例子加入IOS平臺:

Adding ios project... 

iOS project created with [email protected] 

Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project 

Fetching plugin "[email protected]" via npm 

Installing "cordova-plugin-whitelist" for ios 

Installing "cordova-plugin-add-swift-support" for ios 

Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to: 

/Users/simon/projects/modus/swiftplugin/modusechopluginswift/testapp2/platforms/ios/TestApp/Bridging-Header.h 

Update IOS build setting EMBEDDED_CONTENT_CONTAINS_SWIFT to: YES 

我實際上得到的是:

Adding ios project... 

Creating Cordova project for the iOS platform: 

Path: platforms/ios 

Package: com.moduscreate.testapp 

Name: TestApp 

iOS project created with [email protected] 

Installing "cordova-plugin-add-swift-support" for ios 

Error: undefined is not a function 

platforms文件夾有一個生成的帶有內容的IOS子文件夾。

我認爲問題在於cordova-plugin-add-swift-support插件。

我在macOS Sierra 10.12上運行xCode 8.0。

有沒有人有任何想法?

回答

0

我是你所關注的教程的作者。我最近更新了它,以解決Swift 3的變化,所以如果你想用最新的Cordova,XCode 8.2和Swift 3語法來嘗試這個,我已經制作了一個新的教程here。在此之後可能會解決您的問題。