vendredi 10 juin 2016

How to add Cordova plugins to Xcode project with embedded Cordova WebView?


I have an Xcode iOS project to which I have successfully added a Cordova WebView.

I stumbled through their tutorial. https://cordova.apache.org/docs/en/latest/guide/platforms/ios/webview.html

How can I add plugins to it?


If I try to use Plugman suggest, I get this error:

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.

Of course this is true. The instructions I followed were for adding the web view to a NON Cordova project.


I also tried adding plugins to the Cordova iOS project before bringing over the config.xml and such from it to my own project.

The result is that the project will launch but I get these errors in the Xcode console:

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.


I tried bringing over the Plugins folder from the reference project to my project. (The one that has files like CDVLogger.h/m and CDVFile.h/m

When I do this, I get build errors:

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)


Aucun commentaire:

Enregistrer un commentaire