-
-
Notifications
You must be signed in to change notification settings - Fork 9
Capacitor v5 usage #9
Comments
You ought to delete the app/project/package.json file, allowing it to rely on external package.json dependencies instead. This issue can catch those who overlook it off guard. For detailed steps on identifying and resolving this problem, please refer to my article at [Medium]. It took me an entire afternoon to navigate through and resolve this perplexing issue. |
It's indeed a concern related to this library. Let's hope for a swift resolution. |
I can confirm I have the same issue when updating to capacitor 5. My plugins were not being detecting and updating the PodFile. Removing the package.json specific to the app folder, leaving only the external worked. |
while removing the Nx workspace app project's to explain: I have a workspace with three mobile applications that, in addition to some common UI components and services, also have unique business logic that depends on a different set of Capacitor plugins. for example: only one of them uses Firebase Cloud Messaging, only one uses TCP Sockets, only one uses BLE, only two of them do file sharing, etc. in these apps, I simply define the Capacitor plugins in the workspace app projects as perhaps this is just something that needs to be documented more clearly? @DominikPieper do you have any particular opinions on this? |
I'm sorry for the confusion earlier. I realized my initial solution was incorrect as it skirted around the issue without grasping the benefits of the intended design. I had resolved this correctly some time ago but failed to locate and update this issue. Thank you for bringing it to my attention. @ZaLiTHkA The right approach is to selectively import the plugins required for our current project. This prevents the Here's how the code looks: {
"name": "qib-ionic",
"devDependencies": {
"@capacitor/cli": "../../node_modules/@capacitor/cli",
"@capacitor/app": "../../node_modules/@capacitor/app",
"@capacitor/core": "../../node_modules/@capacitor/core",
"@capacitor/network": "../../node_modules/@capacitor/network",
"@capacitor/assets": "../../node_modules/@capacitor/assets",
"@capacitor/splash-screen": "../../node_modules/@capacitor/splash-screen",
"@capacitor/preferences": "../../node_modules/@capacitor/preferences",
"@capacitor/camera": "../../node_modules/@capacitor/camera",
"@capacitor/toast": "../../node_modules/@capacitor/toast",
"@capacitor/haptics": "../../node_modules/@capacitor/haptics",
"@capacitor/filesystem": "../../node_modules/@capacitor/filesystem",
"@capacitor/text-zoom": "../../node_modules/@capacitor/text-zoom",
"@capacitor-mlkit/barcode-scanning": "../../node_modules/@capacitor-mlkit/barcode-scanning"
}
}
The capacitor.build.gradle file is structured as follows:
|
Describe the bug
When we install a plugin for example like FileSystem and try to sync it does not work. Its only when we add the package to the app/project/package.json does it work.
To Reproduce
Steps to reproduce the behavior:
npx cap sync android
.Expected behavior
We shouldn't have to add the dependency to the app's json
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: