Closed LillyWebsites closed 5 years ago
Would you be able to run npm info phonegap
in terminal and confirm that the version of cordova being used is 8.0.0 or above (under dependencies)?
C:\Users\Besitzer>npm info phonegap
phonegap@8.2.2 | Apache-2.0 | deps: 18 | versions: 192 PhoneGap command-line interface and node.js library. http://github.com/phonegap/phonegap-cli
keywords: cli, cordova, phonegap, phonegap build, phonegap/build
bin: phonegap
dist .tarball: https://registry.npmjs.org/phonegap/-/phonegap-8.2.2.tgz .shasum: 1e1a719a14d79aefcf30c3b37e83d6cd543a7a3e .integrity: sha512-QOU2rNRiDp6vjP6o6gl6awv544zXFtw0VDCUnMZdzw4DXrs2nMR6L4XmZOpFLhGTIAJe51gIJ6+WfBllLP1oRQ== .unpackedSize: 360.9 kB
dependencies: archiver: ^1.0.0 jasmine: ^3.2.0 pluralize: 0.0.4 colors: 0.6.0-1 minimist: 0.1.0 prompt: ^1.0.0 configstore: 1.4.0 opener: 1.4.1 qrcode-terminal: 0.9.4 connect-phonegap: ^0.25.0 opn: ^4.0.2 request: ^2.88.0 cordova: ^8.1.2 os-name: 2.0.1 shelljs: 0.1.4 insight: ^0.10.1 phonegap-build: ^1.0.0 update-notifier: ^0.6.0
maintainers:
dist-tags: 3.5.0-0.19.23: 3.5.0-0.19.23 latest: 8.2.2
published a week ago by purplecabbage purplecabbage@gmail.com
I am not sure what the issue might be here. It seems like you are meeting all of the necessary requirements. I have not used this repository with PhoneGap before, only using Cordova. Have you had any progress with this?
Please re-open if you are continuing to experience this issue.
Still having the same problem, even on a completely new laptop with new phonegap installation,
C:\MyAppPath>phonegap plugin add cordova-plugin-foreground-service -d No scripts found for hook "before_plugin_add".
No version specified for cordova-plugin-foreground-service, retrieving version from config.xml
No version for cordova-plugin-foreground-service saved in config.xml or package.json
Attempting to use npm info for cordova-plugin-foreground-service to choose a compatible release
Running command: cmd "/s /c ""C:\Program Files\nodejs\npm.cmd" view cordova-plugin-foreground-service --json""
Command finished with error code 0: cmd /s /c ""C:\Program Files\nodejs\npm.cmd" view cordova-plugin-foreground-service --json"
npm info for cordova-plugin-foreground-service did not contain any engine info. Fetching latest release Calling plugman.fetch on plugin "cordova-plugin-foreground-service"
saving exact
Running command: cmd "/s /c ""C:\Program Files\nodejs\npm.cmd" install cordova-plugin-foreground-service --production --save-exact""
Command finished with error code 0: cmd /s /c ""C:\Program Files\nodejs\npm.cmd" install cordova-plugin-foreground-service --production --save-exact"
Copying plugin "C:\MyAppPath\node_modules\cordova-plugin-foreground-service" => "C:\MyAppPath\plugins\cordova-plugin-foreground-service"
Calling plugman.install on plugin "C:\MyAppPath\plugins\cordova-plugin-foreground-service" for platform "android
Installing "cordova-plugin-foreground-service" for android
Running command: cmd "/s /c ""C:\MyAppPath\platforms\android\cordova\version.bat"""
Command finished with error code 0: cmd /s /c ""C:\MyAppPath\platforms\android\cordova\version.bat""
android-sdk version check failed ("C:\MyAppPath\platforms\android\cordova\android_sdk_version"), continuing anyways.
Finding scripts for "before_plugin_install" hook from plugin cordova-plugin-foreground-service on android platform only.
No scripts found for hook "before_plugin_install". Install start for "cordova-plugin-foreground-service" on android.
PlatformApi successfully found for platform android
Android Studio project detected
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-plugin-foreground-service on android.
Seems it was following line that was missing:
<preference name="phonegap-version" value="cli-8.2.2" />
Now foregroundservice is no longer undefined and message is shown. But gps symbol vanishes, when I minimze my app (press home button) => it is not executed in background
When you say the GPS symbol vanishes, does your notification icon disappear when you minimize the app? Also please check the updated README, just to make sure that you are using another plugin that will be running a background task that will actually keep your app running.
OK, new ReadMe explained my mistake. Thought this would replace cordova-plugin-background-mode. I will activate both.
Sorry for the confusion! Open this task again if you continue to have the same issues, or open another if the issue changes.
I get this message when I add the plugin.
Phonegap-Version 8.2.2 Phonegap-Android 7.1.2
what else do I need? It installs anyways, but cordova.plugins.foregroundService is undefined.