【发布时间】:2018-06-03 04:26:57
【问题描述】:
我目前正在构建一个 Ionic 3 项目,我需要开发一个自定义 Cordova 插件,该插件需要一个用于 iOS 平台的 Pod (https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library)。
我加了一行
<framework src="iOSDFULibrary" type="podspec" spec="4.1.0"/>
到plugin.xml文件,
的子元素<platform name="ios">
它似乎没有安装 Pod 依赖项。然后创建 podfile,将所需的 pod 添加到 podfile
target 'MyApp' do
use_frameworks!
pod 'iOSDFULibrary'
end
最后运行 pod install。我修复了 Xcode 的一些依赖问题(对嵌入式库和运行路径使用 $(inherited))
然后我运行
ionic cordova build ios
从根目录,我收到以下错误:
ProcessProductPackaging "" /Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-cnmgcjqxsbizwzgzyunkhpaidafn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Zip.build/Zip.framework.xcent
cd /Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/XXX/Documents/dev/app/test/ble/ble/last/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/Cellar/android-sdk/24.1.2/tools:/usr/local/Cellar/android-sdk/24.1.2/platform-tools≈"
builtin-productPackagingUtility -entitlements -format xml -o /Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-cnmgcjqxsbizwzgzyunkhpaidafn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Zip.build/Zip.framework.xcent
warning: Falling back to contents of entitlements file "Entitlements-Debug.plist" because it was modified during the build process. Modifying the entitlements file during the build is unsupported.error: The file “Entitlements-Debug.plist” couldn’t be opened because there is no such file.
=== BUILD TARGET CordovaLib OF PROJECT CordovaLib WITH CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
/bin/mkdir -p /Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/build/sharedpch/CordovaLib_Prefix-asuvblhsjpogpaeowyccynwoocft
write-file /Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/build/sharedpch/CordovaLib_Prefix-asuvblhsjpogpaeowyccynwoocft/CordovaLib_Prefix.pch.pch.hash-criteria
write-file /Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-cnmgcjqxsbizwzgzyunkhpaidafn/Build/Intermediates.noindex/CordovaLib.build/all-product-headers.yaml
** BUILD FAILED **
The following build commands failed:
ProcessProductPackaging "" /Users/XXX/Library/Developer/Xcode/DerivedData/MyApp-cnmgcjqxsbizwzgzyunkhpaidafn/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Zip.build/Zip.framework.xcent
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/cordova/build-debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/XXX/Documents/dev/app/test/ble/ble/last/platforms/ios/build/sharedpch
第一个问题:如何将一个用swift编写的Cocoapod绑定到一个用swift编写的自定义插件?
第二个问题:ProcessProductPackaging是什么意思?
文档
https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html
How to bundle Cocoapod dependencies with Cordova Plugin?
https://github.com/blakgeek/cordova-plugin-cocoapods-support
任何建议表示赞赏
【问题讨论】:
-
这里有同样的错误。你能修好它吗?如果是,请将其作为答案发布在这里。
-
@AshishKanswal 我放弃并转向原生解决方案
标签: ios xcode cordova plugins ionic2