Closed invention7 closed 5 years ago
post your platforms/android/project.properties
target=android-27 android.library.reference.1=CordovaLib android.library.reference.2=app cordova.gradle.include.1=com-sarriaroman-photoviewer/dev-photoviewer.gradle cordova.gradle.include.2=cordova-plugin-background-fetch/dev-build.gradle cordova.system.library.1=com.google.android.gms:play-services-location:15.0.1 cordova.system.library.2=com.android.support:appcompat-v7:27.0.0 cordova.gradle.include.3=cordova-background-geolocation/dev-build.gradle cordova.gradle.include.4=cordova-plugin-badge/dev-badge.gradle cordova.system.library.3=com.android.support:support-v4:24.1.1+ cordova.system.library.4=com.facebook.android:facebook-android-sdk:4.36.0 cordova.gradle.include.5=cordova-plugin-firebase/dev-build.gradle cordova.system.library.5=com.google.gms:google-services:+ cordova.system.library.6=com.google.android.gms:play-services-tagmanager:+ cordova.system.library.7=com.google.firebase:firebase-core:+ cordova.system.library.8=com.google.firebase:firebase-messaging:+ cordova.system.library.9=com.google.firebase:firebase-crash:+ cordova.system.library.10=com.google.firebase:firebase-config:+ cordova.system.library.11=com.google.firebase:firebase-perf:+ cordova.system.library.12=com.android.support:support-annotations:27.+ cordova.system.library.13=com.android.support:support-v4:26.+ cordova.gradle.include.6=cordova-plugin-local-notification/dev-localnotification.gradle cordova.gradle.include.7=cordova-support-google-services/dev-build.gradle cordova.system.library.14=com.google.firebase:firebase-core:15.0.0 cordova.system.library.15=com.google.firebase:firebase-firestore:15.0.0 cordova.gradle.include.8=cordova-background-geolocation-firebase/dev-build.gradle
Your dependencies are a mess of conflicting versions.
ok.
I just reverted to my working code (pre cordova-background-geolocation-firebase install). Axed plugins/ and platforms/ Did a clean add of android platform and built successfully.
Posting the resulting project.properties below. Does this offer you any opportunity for insight into what is causing the mess of conflicting versions?
(in other words, the project.properties below builds; when I add the plugin, I get the project.properties above. Can you glean any area to focus my investigation?)
target=android-27 android.library.reference.1=CordovaLib android.library.reference.2=app cordova.gradle.include.1=com-sarriaroman-photoviewer/dev-photoviewer.gradle cordova.gradle.include.2=cordova-plugin-background-fetch/dev-build.gradle cordova.system.library.1=com.google.android.gms:play-services-location:15.0.1 cordova.system.library.2=com.android.support:appcompat-v7:27.0.0 cordova.gradle.include.3=cordova-background-geolocation/dev-build.gradle cordova.gradle.include.4=cordova-plugin-badge/dev-badge.gradle cordova.system.library.3=com.android.support:support-v4:24.1.1+ cordova.system.library.4=com.facebook.android:facebook-android-sdk:4.36.0 cordova.gradle.include.5=cordova-plugin-firebase/dev-build.gradle cordova.system.library.5=com.google.gms:google-services:+ cordova.system.library.6=com.google.android.gms:play-services-tagmanager:+ cordova.system.library.7=com.google.firebase:firebase-core:+ cordova.system.library.8=com.google.firebase:firebase-messaging:+ cordova.system.library.9=com.google.firebase:firebase-crash:+ cordova.system.library.10=com.google.firebase:firebase-config:+ cordova.system.library.11=com.google.firebase:firebase-perf:+ cordova.system.library.12=com.android.support:support-annotations:27.+ cordova.system.library.13=com.android.support:support-v4:26.+ cordova.gradle.include.6=cordova-plugin-local-notification/dev-localnotification.gradle
for one thing, all com.android.support
dependencies should be aligned and correspond to your target=android-27
.
cordova.system.library.2=com.android.support:appcompat-v7:27.0.0
cordova.system.library.3=com.android.support:support-v4:24.1.1+
cordova.system.library.12=com.android.support:support-annotations:27.+
cordova.system.library.13=com.android.support:support-v4:26.+
+
is always suspicious.I know on the regular cordova-background-geolocation issues, I've seen some success using plugins like cordova-android-play-services-gradle-release and cordova-android-firebase-gradle-release to align versions. Do you think using some combinations of plugins is a viable route, or do you think the choice is really to manually align the versions in project.properties? (and maybe codifying in a cordova hook to make a repeatable process?)
make it build by manually tweaking first.
I'll give it a go and get back to you. Thanks, Chris.
Thanks for the guidance, Chris. Got it building and codified the explicit versions in a build-extras.gradle which I've got coming in to platforms/android via a hook. Closing
@christocracy I had the same issue but I had changed it by changing
cordova.system.library.1=com.google.android.gms:play-services-location:16.+
to
cordova.system.library.1=com.google.android.gms:play-services-location:15.+
in platforms/android/project.properties
Locally that works but when I push the code on dashboard.ionicframework
and build the app it fails there because we don't push the platform
folder in dashboard.ionicframework
, could you please help me what should I do to resolve that issue?
See the README for GOOGLE_API_VERSION
Installed GOOGLE_API_VERSION=15.+
but it does not work
Logs.
How can get logs?
FAILURE: Build failed with an exception.
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
Installed plugin
"cordova-background-geolocation-firebase": "0.0.1",
"cordova-support-google-services": "^1.2.1",
"cordova": {
"plugins": {
"cordova-background-geolocation": {
"GOOGLE_API_VERSION": "15.+",
"APPCOMPAT_VERSION": "27.1.1",
"BACKGROUND_MODE_LOCATION": "<string>location</string>",
"LOCATION_ALWAYS_AND_WHEN_IN_USE_USAGE_DESCRIPTION": "Always use is required for constant background location-tracking",
"LOCATION_ALWAYS_USAGE_DESCRIPTION": "Background location-tracking is required",
"LOCATION_WHEN_IN_USE_USAGE_DESCRIPTION": "Background location-tracking is required",
"MOTION_USAGE_DESCRIPTION": "Using the accelerometer increases battery-efficiency by intelligently toggling location-tracking only when the device is detected to be moving"
},
"cordova-support-google-services": {},
"cordova-background-geolocation-firebase": {
"LICENSE": "",
"FIREBASE_CORE_VERSION": "15.+",
"FIREBASE_FIRESTORE_VERSION": "17.1.0"
}
}
I need to document these two --variable
of the firebase adapter.
FIREBASE_CORE_VERSION
FIREBASE_FIRESTORE_VERSION
I would start by making sure all the Google dependencies are importing latest versions. You can determine latest versions by browsing the tree @ http://maven.google.com
GOOGLE_API_VERSION
(this is for play-services-location
of background-geolocation): 16.0.0FIREBASE_CORE_VERSION: 16.0.9
FIREBASE_FIRESTORE_VERSION: 19.0.0
Test on your local build first. Ensure your project.properties
reflects these updated versions.
I probably need to update the cordova-support-google-services dependency as well, which is at 1.3.1
now.
It's been a while since I've tested the firebase adapter for Cordova. I'll whip up a Hello World on Monday using latest dependencies.
Thanks @christocracy, It works!
Hi Chris,
I know from the main repository's issues that play-services versioning tends to be the bane of your existence. Hoping you've got an immediate idea, if not, I'll continue tinkering.
I can build fine with cordova-background-geolocation (I've hosed platforms/ and plugin/ rebuilt the android platform and works fine). Once I add cordova-background-geolocation-firebase and do an android build, I fail with :
What went wrong: Failed to notify dependency resolution listener.
Pasting below my templated config.xml (I use a project called 'ionic-config' to fill in variables per my 'dev', 'staging', and 'prod' platforms)
Any ideas are appreciated.
Thanks for the help.
<?xml version='1.0' encoding='utf-8'?>