Error: Can't resolve 'cordova/exec' when using Cordova plugin
See original GitHub issueI am trying to use cordova-plugin-mauron85-background-geolocation
so I can collect geolocation data while the app is in the background (see #516).
However following these instructions ends up giving me a build error: Error: Can't resolve 'cordova/exec'
. I believe this is the offending line, however running npm install cordova
does not fix the issue.
Is there something really obvious I’m missing?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
`cordova.exec` not working in capacitor project - Stack Overflow
The problem is in the cordova plugin not being executed: cordova.exec(successCallback, errorCallback, 'MsalPlugin', 'msalInit', [JSON.stringify( ...
Read more >Using Cordova Plugins and Ionic Native - Capacitor
Using Cordova Plugins and Ionic Native. When developing an app that uses Capacitor, it's possible to use both Cordova and Ionic Native plugins....
Read more >Android Plugin Development Guide - Apache Cordova
Android Plugin Development Guide. This section provides details for how to implement native plugin code on the Android platform.
Read more >Can't import Cordova Zip plugin - ionic-v3
To fix this I just removed all entries related to this plugin from the package. json file and then installed everything again.
Read more >cordova-js - npm
js process is a Node.js script that concatenates all of the core Cordova plugins in this repository into a cordova.<platform>.js file under the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else wanting to use the
cordova-plugin-mauron85-background-geolocation
plugin, this is what I ended up doing to get it working on Android:npm install cordova-plugin-mauron85-background-geolocation
npm install cordova-android-play-services-gradle-release
(optional, fixes compatibility with Capacitor’s PushNotification plugin)npx cap copy
android/app/src/main/res/values/strings.xml
:This worked for me, based on this snippet from @mauron85: