2016-10-09 56 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。在此之后可能会解决您的问题。