Conflict plugin cordova-plugin-background-geolocation installed
jasonfish568 opened this issue · 5 comments
Your Environment
- Plugin version: 3.1.0
- Platform: Android
- OS version: Any
- Device manufacturer and model: Not related
- Running in Simulator: Not related
- Cordova version (
cordova -v
): 10.0.0 - Cordova platform version (
cordova platform ls
): android 9.1.0 - Plugin configuration options: Not related
- Link to your project:
Context
This brought up my attention when build using Ionic Appflow. When doing cordova platform add android, the program detects plugin cordova-plugin-background-geolocation and installs it. However, it installed the original cordova-plugin-background-geolocation plugin not @mauron85/cordova-plugin-background-geolocation even though I only have @mauron85/cordova-plugin-background-geolocation listed in the package.json. Then in the plugins folder, cordova-plugin-background-geolocation is now the incorrect version.
Expected Behavior
The program should not add cordova-plugin-background-geolocation but use @mauron85/cordova-plugin-background-geolocation.
Actual Behavior
Both cordova-plugin-background-geolocation and @mauron85 are installed by npm but ionic plugins folder has cordova-plugin-background-geolocation because due to the ordering index it's added later than @mauron85/cordova-plugin-background-geolocation.
Possible Fix
Not known. But remove @mauron85/cordova-plugin-background-geolocation and cordova-plugin-background-geolocation from package.json before adding android platform, then add it after adding the platform can make it work.
Steps to Reproduce
- Clean up project by
cordova platform rm android
- Remove plugins and node_modules folder
- run
npm install
- run
cordova platform add android
- run
cordova build android
then an error msg pops up saying Java Http not found
Context
Unable to build using Appflow.
Debug logs
Task :app:compileDebugJavaWithJavac FAILED
.../platforms/android/app/src/main/java/com/zencity/cordova/bgloc/LocationUpdateService.java:6: error: package org.apache.http does not exist
import org.apache.http.HttpResponse;
^
.../platforms/android/app/src/main/java/com/zencity/cordova/bgloc/LocationUpdateService.java:7: error: package org.apache.http.client.methods does not exist
import org.apache.http.client.methods.HttpPost;
^
.../platforms/android/app/src/main/java/com/zencity/cordova/bgloc/LocationUpdateService.java:8: error: package org.apache.http.entity does not exist
import org.apache.http.entity.StringEntity;
^
.../platforms/android/app/src/main/java/com/zencity/cordova/bgloc/LocationUpdateService.java:9: error: package org.apache.http.impl.client does not exist
import org.apache.http.impl.client.DefaultHttpClient;
^
.../platforms/android/app/src/main/java/com/zencity/cordova/bgloc/LocationUpdateService.java:662: error: cannot find symbol
DefaultHttpClient httpClient = new DefaultHttpClient();
^
symbol: class DefaultHttpClient
location: class LocationUpdateService
same error :/
This error came up recently I believe, my appflow build in June did get through with no error.
Did you solve this?
Adding a platform doesn't work for the same problem.
Did you solve this?
Adding a platform doesn't work for the same problem.
No mate. Planning to move onto alternative plugin.