cordova-plugin-background-geolocation: Unable to generate signed apk

Your Environment

  • Plugin version: 3.1.0
  • Platform: Android
  • OS version:
  • Device manufacturer and model:
  • Running in Simulator:
  • Cordova version (cordova -v): — Capacitor with navite plugin
  • Cordova platform version (cordova platform ls): —
  • Plugin configuration options:
  • Link to your project:

Context

Trying generating signed apk in android studio.

Expected Behavior

Actual Behavior

Gets error:

  • Type org.apache.commons.io.Charsets is defined multiple times
  • com.android.tools.r8.CompilationFailedException: Compilation failed to complete

Possible Fix

Steps to Reproduce

Plugins: @mauron85/cordova-plugin-background-geolocation (3.1.0) cordova-plugin-actionsheet (2.3.3) cordova-plugin-badge (0.8.8) cordova-plugin-device (2.0.3) cordova-plugin-dialogs (2.0.2) cordova-plugin-ionic (5.4.7) cordova-plugin-whitelist (1.3.4) cordova-sms-plugin (1.0.0) uk.co.workingedge.phonegap.plugin.launchnavigator (5.0.4)

Context

Problem appears only on signed apk

Debug logs

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Commits related to this issue

Most upvoted comments

I’ve created fork to solve this problem https://github.com/darron1217/cordova-plugin-background-geolocation/tree/bugfix

You can install it by npm install https://github.com/darron1217/cordova-plugin-background-geolocation.git#bugfix

@vuk-nikolic could you elaborate a bit more please, I am facing the same issue and got stuck on the

AAPT: error: resource string/mauron85_bgloc_content_authority (aka capacitor.android.plugins:string/mauron85_bgloc_content_authority) not found.

@LgArcida this is how you fix it

I’m not a maintainer of the project (or connected to it). In the workaround that worked for me I physically copied the file to plugin’s location for string.xml

Can’t really help you more than that, I do not know plugin’s internals.

In our case it was a bit of a pain to make it work with capacitor/ionic combo.

Awesome work @darron1217 that saved the day!

I had the same issue while trying to sign the app. It was working without signing. Can we get this merged @mauron85? 🙏

In appflow now I have progress, and getting the same thing mentioned here https://github.com/mauron85/cordova-plugin-background-geolocation/issues/562#issuecomment-588174021