Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70811

No such module '..Kit' when using Capacitor Plugin

$
0
0

I’m building an Capacitor Plugin. To autenticate a user using WebAuthn (since this is not yet suported in WKWebView-based browsers)

Within this plugin I’m using WebAuthnKit I added it to my Podfile of my plugin. Like so:

...
use_frameworks!
pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
pod 'WebAuthnKit', '~> 0.9.5'
...

After running pod install it works great! Also when I build only my plugin using xcode it builds successfully

But then when I use my plugin in my ionic capacitor app (installed locally via npm) xcode spits out the error
No such module 'WebAuthnKit' on the line in the plugin code where I do import WebAuthnKit to use it.

I can fix it by hand but after running ionic cap sync ios all my changes are gone!
What I do to fix it:

  1. Also add pod 'WebAuthnKit', '~> 0.9.5'to my ionic app podfile
  2. Also run pod install in the ios/App folder of my ionic app
  3. Select Pods project from xcode
  4. Select CapacitorMyPlugin from the targets panel to select my plugin
  5. Add WebAuthnKit to the list of Link Binary With Libraries under Build Phases
  6. Add "${PODS_CONFIGURATION_BUILD_DIR}/WebAuthnKit" in the Framework Search Paths (debug and release) under Build Settings

After this is done the error is gone but I have to repeat these steps after every ionic cap sync ios.

Has anyone used external Kits in a Capacitor Plugin?
How do you link the correct pods from xcode workspace?

(opening .xcodeproj or .xcworkspace makes no difference only when opening .xcodeproj it sais No such module ‘Capacitor’)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70811

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>