Open bsjaffer opened 7 years ago
Same, just started... at a not very convenient time :P
+1 no fix yet.
` FAILURE: Build failed with an exception.
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.`
Build was working fine until this release from yesterday ( May 16, 2017 ) : https://bintray.com/android/android-tools/com.google.gms.google-services/3.1.0
A fix that seems to progress the build process further is:
Change the file src/android/FCMPlugin.gradle
, and change the dependency:
classpath 'com.google.gms:google-services:+'
to
Update, set it to classpath 'com.google.gms:google-services:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
You have to remove/add the platform for this to work.
Update: Removed the error that v2.1.2 threw.
Update: Updated the above example
Ok the actual fix is:
Use the strategy above, but set the dependency to 3.0.0, like so:
classpath 'com.google.gms:google-services:3.0.0'
Remember to remove the platform, and readd.
It works for me too, but every time we need to change this ? are this is only for temporary purpose.
Temporary hopefully
@larssn Thanks so much for the fix ! I did a PR for fechanique with your fix (I didn't see one with this change) https://github.com/fechanique/cordova-plugin-fcm/pull/309
Thanks @larssn for the fix.
Thanks. Fixed my problem.
Thanks, u save me
also remember to remake resources :)
Hi may I know what is the exact fix ??
Below is my project.properties file
target=android-23 android.library.reference.1=CordovaLib cordova.gradle.include.1=cordova-plugin-badge/usc-badge.gradle cordova.system.library.1=com.android.support:support-v4:+ cordova.system.library.2=com.google.firebase:firebase-core:+ cordova.system.library.3=com.google.firebase:firebase-messaging:+ cordova.gradle.include.2=cordova-plugin-fcm/usc-FCMPlugin.gradle cordova.system.library.4=com.squareup.okhttp3:okhttp:3+
The below is the dependancy in Build.gradle file of PROJECT_NAME/platforms/android/build.gradle file
dependencies { classpath 'com.android.tools.build:gradle:1.5.0' }
Below is the issue i get :
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.
Can anyone tell me what is exact fix ???
After reading the above posts I did the following change in project.properties file. Build becomes successful but the App crashes.
target=android-23 android.library.reference.1=CordovaLib cordova.gradle.include.1=cordova-plugin-badge/usc-badge.gradle cordova.system.library.1=com.android.support:support-v4:+ cordova.system.library.2=com.google.firebase:firebase-core:9.0.0 cordova.system.library.3=com.google.firebase:firebase-messaging:9.0.0 cordova.gradle.include.2=cordova-plugin-fcm/usc-FCMPlugin.gradle cordova.system.library.4=com.squareup.okhttp3:okhttp:3+
Can anyone tell me what to do in the above config file to fix the build issue and that app should run withouty crash.
@rehanhanar7 : Well you can either edit your own cordova-plugin-fcm files to implement @larssn 's fix (it's a one-line change) or use a fork of fechanique's repository with the fix (https://github.com/lp1bp/cordova-plugin-fcm for instance) while you wait for a PR to be approved/merged
@lp1bp Thanks Man !!! The plugin link which you gave works fine. Try to Commit the same in this plugin. I guess this will be the temporary solution
@rehanhanar7 : You're welcome, I'll keep my fork as up to date as possible since we're using it in production on a few hundreds of devices :)
Note: if you're using firebase, make sure to set the Google Services version (3.0.0
) in all firebase plugins as well.
The solution above doesn't work on iOS (10.3.1):
*** Terminating app due to uncaught exception 'com.firebase.core', reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.'
Update: Seems to be an issue with cordova-ios v4.4.0. I just installed a previous version (v4.2.1) and it 's working again.
there's a lot of PR to be accepted, but the owner got lost since january. I've tried the @lp1bp fork and it's working now.
Thank you @lp1bp and @larssn!
Ive tried the above fix, but now get:
FAILURE: Build failed with an exception.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.okio/okio/pom.xml File1: C:\Users\Eric.gradle\caches\modules-2\files-2.1\com.squareup.okio\okio\1.6.0\98476622f10715998eacf9240d6b479f12c66143\okio-1.6.0.jar File2: C:\BB\mobile.addmembers.com\rainmaker\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\10.2.6\jars\classes.jar
Any ideas? It builds and launches fine when I remove the plugin entirely
@elewin i think you are used 2.1.2 change to classpath 'com.google.gms:google-services:3.0.0' and remove and re add platform . Try
Same issue for me also, its not working...
:transformResourcesWithMergeJavaResForDebug FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties File1: C:\Users\Theerthagiri.gradle\caches\modules-2\files-2.1\com.squareup.okhttp3\okhttp\3.8.0\5a11f020cce2d11eb71ba916700600e18c4547e7\okhttp-3.8.0.jar File2: E:\App\MobileAppBuild\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\10.2.6\jars\classes.jar
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Same for me also... Not working
Worked. Thanks @lp1bp
@lp1bp can you make your solution compliant with IOS versions less then 10 using the solution here: https://github.com/fechanique/cordova-plugin-fcm/issues/247#issuecomment-281119246
@ysayita Isn't it working with these changes ? https://github.com/lp1bp/cordova-plugin-fcm/commit/0f23b5344ec781bbac20155efc60f6b4bde8654a It's working for me on ios <10
@lp1bp it seems like it is working but we cannot acquire FCM token with the version you provided on ios <10. So it does not receive the notifications. Removing lines 111 and 165 as suggested on https://github.com/fechanique/cordova-plugin-fcm/issues/247#issuecomment-281119246 causes it to stop working with ios 10 too.
@ysayita : I'm using my fork of the plugin on iOS 9.3 and it works well, did you try to use both onTokenRefresh and getToken ?
+99 been waiting for a fix forever, nothing is working for me.
@lp1bp thanks for your support. Using both onTokenRefresh and getToken bindings resolved the problem. Your code successfully works on IOS 9.3.5 now.
@ysayita You're welcome ! I'm glad it works now
Unfortunately, I'm still running into this issue :/
My app-FCMPlugin.gradle file looks like this:
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.0.0'
}
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
yet I'm still getting this error:
* What went wrong:
Execution failed for task ':processArmv7DebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version if available https://bintray.com/adnroid/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0
As I've been researching this problem, I've noticed that the task is very similar minus the Armv7
part. Could that be an Android Studio issue maybe? I mean, I've installed pretty much every single plugin for Android Studio so I'm not sure. Does anyone have any insight here?
There's a fork of this repo that fixes it. Look that up and then replace the official plugin name with he github url in your config xml file
On Jul 19, 2017 5:49 AM, "Stevie Starosciak" notifications@github.com wrote:
Unfortunately, I'm still running into this issue :/
My app-FCMPlugin.gradle file looks like this:
buildscript { repositories { jcenter() mavenLocal() } dependencies { classpath 'com.android.tools.build:gradle:+' classpath 'com.google.gms:google-services:3.0.0' } } // apply plugin: 'com.google.gms.google-services' // class must be used instead of id(string) to be able to apply plugin from non-root gradle file apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
yet I'm still getting this error:
- What went wrong: Execution failed for task ':processArmv7DebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version if available https://bintray.com/adnroid/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0
As I've been researching this problem, I've noticed that the task is very similar minus the Armv7 part. Could that be an Android Studio issue maybe? I mean, I've installed pretty much every single plugin for Android Studio so I'm not sure. Does anyone have any insight here?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fechanique/cordova-plugin-fcm/issues/306#issuecomment-316208320, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUzRZs2psbr3jyRy0qMVI59o6jnQJKcks5sPShRgaJpZM4NdnMY .
After upgrading to v2.1.2,
On ionic build android
we are getting
FAILURE: Build failed with an exception.
* Where:
Script '/ff-client-app/platforms/android/cordova-plugin-fcm/clientapp-FCMPlugin.gradle' line: 11
* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'com.google.gms.google-services' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Not sure how to proceed. Maybe there's an SDK component missing? In our Docker file, the sections that cover android sdk setup are:
#########################################################
#ANDROID STUFF
#########################################################
RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --force-yes expect ant wget libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
cd /opt && \
wget --output-document=android-sdk.tgz --quiet http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz && \
tar -xvf android-sdk.tgz && \
chown -R root. /opt
#########################################################
# Install phantomjs, otherwise npm -g fails
#########################################################
# RUN npm install -g phantomjs-prebuilt
#########################################################
# Setup environment
#########################################################
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/tools:/opt/gradle/gradle-3.3/bin
#########################################################
# Install sdk elements
#########################################################
COPY tools /opt/tools
RUN chmod +x /opt/tools/android-accept-licenses.sh && \
chmod +x /opt/tools/android-sdk-install.sh
RUN ["/opt/tools/android-accept-licenses.sh","android update sdk --all --no-ui --filter platform-tools,tools,build-tools-23.0.2,android-23,android-24,android-25,extra-android-support,extra-android-m2repository,extra-google-m2repository"]
RUN unzip ${ANDROID_HOME}/temp/*.zip -d ${ANDROID_HOME}
The app package.json file is:
{
"name": "XXX",
"version": "1.0.8",
"description": "XXX",
"dependencies": {
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-replace": "^0.5.4",
"gulp-util": "^2.2.14",
"ip": "^1.1.4",
"jasmine-core": "^2.5.1",
"karma": "^1.3.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"shelljs": "^0.3.0",
"xcode": "^0.8.9",
"yargs": "^6.6.0"
},
"cordovaPlugins": [
"cordova-plugin-geolocation",
"cordova-plugin-whitelist",
"cordova-plugin-crosswalk-webview",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"cordova-plugin-fcm",
"uk.co.workingedge.phonegap.plugin.launchnavigator",
"cordova-plugin-x-toast",
{
"variables": {
"FABRIC_API_KEY": "XXX",
"FABRIC_API_SECRET": "XXX"
},
"locator": "cordova-fabric-plugin@1.1.1",
"id": "cordova-fabric-plugin@1.1.1"
},
"cordova-plugin-device",
"cordova-plugin-network-information",
"cordova-plugin-inappbrowser",
{
"variables": {
"APP_ID": "XXX",
"APP_NAME": "XXX"
},
"locator": "cordova-plugin-facebook4",
"id": "cordova-plugin-facebook4"
},
"cordova-plugin-screen-orientation",
{
"variables": {
"BRANCH_KEY": "XXX",
"URI_SCHEME": "XXX"
},
"locator": "branch-cordova-sdk",
"id": "branch-cordova-sdk"
}
],
"cordovaPlatforms": [
"ios",
"android"
]
}
I've changed to cordova-plugin-firebase. It's more complete and developing active.
The changes are minimal to switch.
Same old, same old.
After running:
$ ionic cordova plugin remove cordova-plugin-fcm
$ ionic cordova plugin add https://github.com/lp1bp/cordova-plugin-fcm
$ ionic cordova build android
* What went wrong:
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 https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
Same error. Any resolution resolve this problem yet.
I had to do a fork: https://github.com/cmgustavo/cordova-plugin-fcm
I was hoping that your fork would do the trick, but did not seem to rectify the problem.
After running,
cordova plugin add https://github.com/cmgustavo/cordova-plugin-fcm
cordova build android
I got the following:
What went wrong: A problem occurred configuring root project android. Cannot add task :processDebugGoogleServices' as a task with that name already exists.
I am attempting to use Firebase Analytics (cordova-plugin-firebase-analytics) which requires Google Services (cordova-support-google-services) and Firebase Cloud Messaging. The cordova-plugin-fcm includes Google Services 3.0.0 and the cordova-support-google-services has Google Services at 3.1.0 creating the conflict.
I am new to using Ionic 3/Angular 4. A fix I had found on a different forum and implemented was changing the version in platforms/android/cordova-support-google-services to 3.0.0 from 3.1.0. But this is a temporary fix, and a Sr. Dev on my team said this was terrible and should never be done.
What is the fix for this?
Right now there is no true "fix" because of different versions of google libraries & firebase plugins. You can fix it for your versions, but due to the velocity of development of Android, Google Services, Ionic, Cordova and the plugins themselves keeping everything cutting edge and up to date would require a unified dev team rather than the community support.
If you make changes by adding, removing, updating plugins or updating versions of ionic it will likely break again. I have had these issues from the day I used any of the Google plugins.
This is an issue with almost ALL of the google and firebase plugins across the board for Cordova and ionic.
Either update them by hand or write scripts using regex/string replace against the generated files to make sure the version numbers stay in sync.
Any solutions about this?
make sure you already installed Google Repository in Android SDK Manager
then simply install FCM plugin. copy google-services.json file to root project folder.
compile "com.facebook.android:facebook-android-sdk:4.+" compile "com.google.firebase:firebase-core:11.0.+" compile "com.google.android.gms:play-services-auth:+" compile "com.google.android.gms:play-services-identity:+" if Change this to this.. compile "com.facebook.android:facebook-android-sdk:4.+" compile "com.google.firebase:firebase-core:11.0.+" compile "com.google.android.gms:play-services-auth:11.0.+" compile "com.google.android.gms:play-services-identity:11.0.+"
while building its changing to previous one ..could any help me on this please
In my opinion, you should stop using fcm, developers are facing issues every time, instead of that, use Phonegap push plugin. it is far better and no conflict issue too.
In platforms > android > cordova-plugin-fcm > app-FCMPlugin.gradle
In platforms > android > build.gradle
IF REQUIRED :
In plugins > cordova-plugin-fcm > plugin.xml to
Suddenly getting this error when i run in android please suggest