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

Created on 21 Jun 2020  路  12Comments  路  Source: mauron85/cordova-plugin-background-geolocation

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

Most helpful comment

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

All 12 comments

I'm able to sign my app, but I'm not using all your plug-ins.
Here's my app package.json file:
https://github.com/IsraelHikingMap/Site/blob/4ed26c9817f1deab55a7a6e80e7e9d4ba006ddb7/IsraelHiking.Web/package.json#L52
Might be a plugin collision, I don't know...

I got the error from:
"cordova-plugin-ionic": "5.4.7",
"cordova-plugin-whitelist": "^1.3.4"

they're added by initializing ionic appflow service

Schermata 2020-07-07 alle 10 58 42

Resolved by editing dependencies and plugin.xml

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

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

@vuk-nikolic I'm having the same issue too. There is a workaround suggested here but I haven't tried it #728 and it seems a bit hacky. Seems like a Capacitor bug, as I have the strings.xml file in the right place, but somehow those values aren't being seen when packaging this plugin.

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

Can鈥檛 really help you more than that, I do not know plugin鈥檚 internals.

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

@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.

@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

sorry @LgArcida, unfortunately we're no longer using this plugin.

@vuk-nikolic Also, if you're using Capacitor, the app will still die after 5 minutes of being in the background because Capacitor turns off timers when going into the background. Not a problem on iOS though. Just saw you're not using it anymore, what plugin did you switch to?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shakti-Sharma picture Shakti-Sharma  路  3Comments

mauron85 picture mauron85  路  4Comments

wrunkel picture wrunkel  路  6Comments

Ritzlgrmft picture Ritzlgrmft  路  6Comments

adrieldubemarante picture adrieldubemarante  路  4Comments