Can anyone help me? I’m kind off lost. I’m using the FCM plugin (version 9.0.0) to receive push notifications. Today I tried adding the Google maps plugin (version 9.8.0). As I suspected, this gave version conflicts in the google services plugin. I’m however not able to solve them. The message was: Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0..
So I downgraded the Google Maps plugin to 9.0.0. This didn’t work unfortunately, because some of the functions didn’t work anymore.
The next thought was upgrading the google services plugin. So I updated the SDK for google play, hoping it would fix things. I however can’t seem to use a higher version of google services, because I get this message when I build: google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used. please apply google-services plugin at the bottom of the build file.
Anybody know how to fix this? I have to use version 9.8.0 of google services, because otherwise the google maps plugin won’t work as expected…
I think I managed to solve it. The FCM plugin uses the gradle file to apply the google-services plugin. What I did:
Comment out these lines in the FCMPlugin.gradle file. classpath 'com.google.gms:google-services:3.0.0' apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
Then change the plugin.xml of the FCM plugin to use a different version, in my situation 9.8.0. <framework src="com.google.firebase:firebase-core:9.8.0" /> <framework src="com.google.firebase:firebase-messaging:9.8.0" />
Now, remove en add the android platform again, so the changes will have affect. The next step is to change the build.gradle file of the android platform folder.
Add this line to the classpath section classpath 'com.google.gms:google-services:3.1.0'
And add this line below the dependencies, nearly at the bottom of the file apply plugin: 'com.google.gms.google-services'
And these changes should fix the problems with the version conflicts.
In my case, Its’ looks similar but I am unable to solve. Please help!
error :Execution failed for task ‘:processDebugGoogleServices’.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog) or updating the version of com.google.android.gms to 9.0.0.
You’ve got exactly the same error as I had, so I don’t think the problem is different. Maybe you could provide more information than just the error? What have you tried to fix it? Which plugins do you have installed? Et cetera
I tried to change the version of com.google.android.gms to 9.0.0 in build gradle of android platform ( refer : https://github.com/fechanique/cordova-plugin-fcm/issues/274#issuecomment-307966519) and also tried your solution but not succeed yet. I also tried to change the gms version on Background Location plugin but it didn’t work.
But if I remove the Background Location plugin then my apps run successfully but I have to use both the plugins but their gms version are not matching. I observed (after going through the code of
plugins on github) that the gradle settings and structure of these plugin are little different.
Please inform if you need any more information about my attempts or plugins.
yes, I removed and added android platform. Error with the gms of Background location is simailar : Found com.google.android.gms:play-services-location:+, but version 9.0.0 is needed for the google-services plugin.
so I changed this in build file and project properties of android platform like ::
but now app crashes on Launch with following log ::
java.lang.IllegalAccessError: Method ‘void android.support.v4.content.ContextCompat.()’ is inaccessible to class ‘com.google.firebase.iid.zzg’ (declaration of ‘com.google.firebase.iid.zzg’.
It’s using the newest version of the plugin com.google.android.gms:play-services-location, hence the +. It needs version 9.0.0. So, try changing the + to 9.0.0.
but now app crashes on Launch with following log ::
java.lang.IllegalAccessError: Method ‘void android.support.v4.content.ContextCompat.()’ is inaccessible to class ‘com.google.firebase.iid.zzg’ (declaration of ‘com.google.firebase.iid.zzg’.
Step 3 (for Background-Geolocation-Plugin) Change the plugin.xml of the Geolocation plugin to use a different version, in my situation 9.8.0 instead of “+”.
I tried your solution but however it is not working. I got below error:
cordova build android
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
(truncated) ... aseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution,
etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareComGoogleAndroidGmsPlayServicesAds1102Library
:prepareComGoogleAndroidGmsPlayServicesAdsLite1102Library
:prepareComGoogleAndroidGmsPlayServicesBase1102Library
:prepareComGoogleAndroidGmsPlayServicesBasement1102Library
:prepareComGoogleAndroidGmsPlayServicesClearcut1102Library
:prepareComGoogleAndroidGmsPlayServicesGass1102Library
:prepareComGoogleAndroidGmsPlayServicesSafetynet1102Library
:prepareComGoogleAndroidGmsPlayServicesTasks1102Library
:prepareComGoogleFirebaseFirebaseAnalytics900Library
:prepareComGoogleFirebaseFirebaseAnalyticsImpl900Library
:prepareComGoogleFirebaseFirebaseCommon900Library
:prepareComGoogleFirebaseFirebaseCore900Library
:prepareComGoogleFirebaseFirebaseIid900Library
:prepareComGoogleFirebaseFirebaseMessaging900Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\Projects\Code\Other\DailySheet\DailySheetMobileApp\platforms\android\src\com\gae\scaffolder\plugin\MyFirebaseMessagingService.java:38:
error: cannot access AbstractSafeParcelable
if( remoteMessage.getNotification() != null){
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note:
D:\Projects\Code\Other\DailySheet\DailySheetMobileApp\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
:compileDebugJavaWithJavac FAILED
BUILD FAILED
Total time: 51.4 secs
Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
D:\Projects\Code\Other\DailySheet\DailySheetMobileApp\platforms\android\src\com\gae\scaffolder\plugin\MyFirebaseMessagingService.java:38:
error: cannot access AbstractSafeParcelable
if( remoteMessage.getNotification() != null){
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note:
D:\Projects\Code\Other\DailySheet\DailySheetMobileApp\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I haven’t clicked any button, i just launched app and immediately it fails to start and displays message.
Also i checked for logs in console, but because application is not starting, i can’t track anything in chrome://inspect.
i did the same but i also have this error :
Cannot add task ‘:processDebugGoogleServices’ as a task with that name already exists.
can you please help me
i’m using geolocation plugin and googlemaps plugin and fcm