在Cordova中,如何导入CocoaPods提供的Starscream(Swift库)

时间:2018-07-05 03:47:52

标签: ios swift cordova cocoapods starscream

我想将CocoaPods的Starscream(一个Swift库)导入到我的Cordova项目中。

  1. 创建一个Cordova项目;
     $ cordova创建SwiftTest3
     $ cd SwiftTest3
  2. 添加两个插件(cordova-plugin-add-swift-support和cordova-plugin-cocoapod-support);
     $ cordova插件添加cordova-plugin-add-swift-support --save
     $ cordova插件添加cordova-plugin-cocoapod-support --save
  3. 添加ios平台;
     $ cordova平台添加ios
     $ cordova要求
  4. 编辑Podfile并添加Starscream;
     //////////////////////
     平台:ios,“ 8.0”
     定位“ HelloCordova”来做
         pod'Starscream','3.0.2'
     结束
     //////////////////////
  5. 运行“ pod安装”;
    $ cd平台/ ios
    $ pod install
  6. 运行“ cordova仿真iOS”,但失败了!!!!!!!
    $ cordova模拟ios

失败的日志:

严重错误:模块映射文件       '/Users/lichangjie/Library/Developer/Xcode/DerivedData/HelloCordova-ffgrnccxvvefrjgmzdzntfirhcjv/Build/Products/Debug-iphonesimulator/Starscream/Starscream.modulemap'       找不到

**生成失败**

以下构建命令失败:     CompileSwift普通x86_64 /Users/lichangjie/Downloads/cordova/SwiftTest3/platforms/ios/Pods/Starscream/Sources/Compression.swift     CompileSwift普通x86_64 /Users/lichangjie/Downloads/cordova/SwiftTest3/platforms/ios/Pods/Starscream/Sources/SSLSecurity.swift     CompileSwift普通x86_64 /Users/lichangjie/Downloads/cordova/SwiftTest3/platforms/ios/Pods/Starscream/Sources/WebSocket.swift     CompileSwiftSources普通x86_64 com.apple.xcode.tools.swift.compiler (4个失败)

(节点:33759)UnhandledPromiseRejectionWarning:命令的错误代码65:带有args的xcodebuild:-xcconfig,/ Users / lichangjie / Downloads / cordova / SwiftTest3 / platforms / ios / cordova / build-debug.xcconfig,-workspace,HelloCordova .xcworkspace,-方案,HelloCordova,-配置,调试,-sdk,iphonesimulator,-destination,platform = iOS Simulator,名称= iPhone X,build,CONFIGURATION_BUILD_DIR = / Users / lichangjie / Downloads / cordova / SwiftTest3 / platforms / ios /构建/模拟器,SHARED_PRECOMPS_DIR = / Users / lichangjie / Downloads / cordova / SwiftTest3 / platforms / ios / build / sharedpch

(节点:33759)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。引发此错误的原因可能是抛出了一个没有catch块的异步函数,或者是拒绝了一个.catch()无法处理的承诺。 (拒绝ID:1)

(节点:33759)[DEP0018] DeprecationWarning:已弃用未处理的承诺拒绝。将来,未处理的承诺拒绝将以非零退出代码终止Node.js进程。

0 个答案:

没有答案