I cannot seem to find a real solution for my problem anywhere.. After following the Capacitor documentation and creating successfully an app as well as a plugin, i've linked them both using the following commands:
in plugin directory:
-npm run build
-npm link
in app's directory:
-npm link plugin-name
-npm install
-npx cap sync
I open the app's workspace and want to run it on my device but instead I am getting an error in the added plugin of the app, that a certain library I'm using in it does not exist.
p.s Plugin builds normally and has no issues. This occurs only after I'm linking both plugin and app. Am I doing something wrong?
The error I'm getting inside the plugin's file. Those are the frameworks linked to the capacitor app.
CodePudding user response:
Running npm install
unlinks whatever is linked.
You should change the order, first npm install
and then npm link plugin-name
.
But it's better if instead of linking the plugin you install it from its local folder.
CodePudding user response:
As of this moment I have solved the issue I had. Shamefully there aren't really any precise documentation regarding the subject so I'll try to answer as best I can:
My issue got resolved when I updated the dependencies
inside the .podspec file inside my plugin's folder.
The specific package I wish to use with the plugin, should be specified inside the .podspec
file i.e. :
s.dependency 'PicUPSDKv3'
should be added.
After running -npx cap sync
on my main project's folder, all pods were initialized correctly and I was able to build and run the project alongside the plugin without any errors.