我一直在关注NativeScript 教程,以构建使用 CocoaPods 的插件。我使用本教程在 Xcode 中创建了一个测试框架。
这是我的目录结构:
├── KnobControl
│ ├── KnobControl
│ ├── KnobControl.podspec
│ └── KnobControl.xcodeproj
├── MYCocoaPodsApp
│ ├── README.md
│ ├── app
│ ├── hooks
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── platforms
│ │ └── ios
│ │ ├── MYCocoaPodsApp
│ │ ├── MYCocoaPodsApp.xcodeproj
│ │ └── Podfile
│ └── webpack.config.js
└── my-plugin
├── package.json
└── platforms
└── ios
└── Podfile
这是里面的东西KnobControl/KnobControl.podspec
Pod::Spec.new do |spec|
spec.name = "KnobControl"
spec.version = "1.0.0"
spec.summary = "A knob control like UISlider, but in circular form"
spec.description = "The knob control is a completely customizable widget that can be used in any iOS app. It also plays a little victory fanfare."
spec.homepage = "http://raywenderlich.com"
spec.license = "MIT"
spec.author = { "Me" => "my@email.address" }
spec.platform = :ios, "12.1"
spec.source = { :path => '.' }
spec.source_files = "KnobControl"
spec.swift_version = "4.2"
end
这是里面的内容my-plugin/platforms/ios/Podfile:
platform :ios, '12.1'
pod 'KnobControl', :path => '../../../KnobControl'
这是MYCocoaPodsApp/platforms/ios/Podfile运行后的内容tns-build ios:
use_frameworks!
target "MYCocoaPodsApp" do
# Begin Podfile - /MYCocoaPodsApp/node_modules/my-plugin/platforms/ios/Podfile
platform :ios, '12.1'
pod 'KnobControl', :path => '../../../KnobControl'
# End Podfile
end
当我运行时,tns build ios我收到以下错误:
Building project...
Xcode build...
warning: The i386 architecture is deprecated for your deployment target (iOS 12.1). You should update your ARCHS build setting to remove the i386 architecture. (in target 'KnobControl')
warning: The i386 architecture is deprecated for your deployment target (iOS 12.1). You should update your ARCHS build setting to remove the i386 architecture. (in target 'Pods-MYCocoaPodsApp')
<unknown>:0: error: iOS 12 does not support 32-bit programs
Command CompileSwiftSources failed with a nonzero exit code
note: Using new build systemnote: Planning buildnote: Constructing build description
** BUILD FAILED **
Command xcodebuild failed with exit code 65
我需要做什么才能使其正常工作?