我有一個Xcode iOS項目,我已經成功添加了Cordova WebView。如何將Cordova插件添加到嵌入式Cordova WebView的Xcode項目中?
我偶然發現他們的教程。 https://cordova.apache.org/docs/en/latest/guide/platforms/ios/webview.html
我該如何添加插件?
如果我嘗試使用Plugman建議,我得到這個錯誤:
plugman install --platform ios --project path/to/my/custom/xcode/project --plugin cordoba-plugin-console
Failed to install 'cordova-plugin-console':CordovaError: The provided path "path/to/my/custom/xcode/project" is not a Cordova iOS project.
當然,這是真的。我遵循的指示是將網絡視圖添加到NON Cordova項目。
我也嘗試在將Cordial iOS項目中的插件添加到自己的項目中之前,將其引入config.xml。
結果是,該項目將推出,但我在Xcode控制檯中看到這些錯誤:
CDVPlugin class CDVFile (pluginName: file) does not exist.
ERROR: Plugin 'File' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
我試圖把在Plugins
文件夾從參考項目到我的項目。 (有像CDVLogger.h/m
和CDVFile.h/m
文件中的一個。當我這樣做,我得到構建錯誤:
duplicate symbol _kCDVFilesystemURLPrefix in: /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVCapture.o /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVLocalFilesystem.o duplicate symbol _kCDVFilesystemURLPrefix in: /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVCapture.o /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVAssetLibraryFilesystem.o duplicate symbol _kCDVFilesystemURLPrefix in: /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVCapture.o /Users/dustinbahr/Library/Developer/Xcode/DerivedData/AudioCapture-hbvwvtednsahtmgofuophnczsnmj/Build/Intermediates/AudioCapture.build/Debug-iphoneos/AudioCapture.build/Objects-normal/arm64/CDVFile.o ld: 6 duplicate symbols for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)