Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict plugin cordova-plugin-background-geolocation installed #756

Open
jasonfish568 opened this issue Jul 14, 2021 · 5 comments
Open

Comments

@jasonfish568
Copy link

jasonfish568 commented Jul 14, 2021

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

  1. Clean up project by cordova platform rm android
  2. Remove plugins and node_modules folder
  3. run npm install
  4. run cordova platform add android
  5. 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

@ktoala
Copy link

ktoala commented Jul 14, 2021

same error :/

@jasonfish568
Copy link
Author

This error came up recently I believe, my appflow build in June did get through with no error.

@chg7896
Copy link

chg7896 commented Sep 23, 2021

Did you solve this?
Adding a platform doesn't work for the same problem.

@jasonfish568
Copy link
Author

Did you solve this?
Adding a platform doesn't work for the same problem.

No mate. Planning to move onto alternative plugin.

@chg7896
Copy link

chg7896 commented Sep 23, 2021

@mauron85
Sorry but do you know about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants