Hello everyone!
I know this is an old problem but I have try it and I can’t fix it:
My app have list plugin
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-file 4.3.2 "File"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-globalization 1.0.9 "Globalization"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-nativestorage 2.2.2 "NativeStorage"
cordova-plugin-photo-library 2.1.0 "Photo Library"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.2.1 "SocialSharing"
cordova-sqlite-storage 2.1.4 "Cordova sqlite storage plugin"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
twitter-connect-plugin 0.6.0 "Twitter Connect"
Then I add plugin ionic cordova plugin add cordova-plugin-fcm
And when run app it show error:
* 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.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] An error occurred while running cordova run android (exit code 1).
my FCMplugin.gradle:
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
my build.gradle in platform android:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))
compile "com.android.support:support-v4:24.1.1+"
compile "com.facebook.android:facebook-android-sdk:4.+"
compile "com.google.android.gms:play-services-auth:+"
compile "com.google.android.gms:play-services-identity:+"
compile "com.google.android.gms:play-services-maps:+"
compile "com.google.android.gms:play-services-location:+"
compile "com.google.firebase:firebase-core:+"
compile "com.google.firebase:firebase-messaging:+"
// SUB-PROJECT DEPENDENCIES END
}
I try fix it with :
- remove platform android
- change version of
compile "com.google.android.gms:play-services-auth:+"
compile "com.google.android.gms:play-services-identity:+"
compile "com.google.android.gms:play-services-maps:+"
compile "com.google.android.gms:play-services-location:+"
compile "com.google.firebase:firebase-core:+"
compile "com.google.firebase:firebase-messaging:+"
FCM config.xml
<framework src="com.google.firebase:firebase-core:9.0.0" />
<framework src="com.google.firebase:firebase-messaging:9.0.0" />
plugin-googlemap config.xml
<framework src="com.google.android.gms:play-services-maps:9.0.0" />
<framework src="com.google.android.gms:play-services-location:9.0.0" />
plugin-googleplus config.xml
<framework src="com.google.android.gms:play-services-auth:9.0.0" />
<framework src="com.google.android.gms:play-services-identity:9.0.0" />
- readd platform android and I have build.gradle in platform android:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))
compile "com.android.support:support-v4:24.1.1+"
compile "com.facebook.android:facebook-android-sdk:4.+"
compile "com.google.firebase:firebase-core:9.0.0"
compile "com.google.firebase:firebase-messaging:9.0.0"
compile "com.google.android.gms:play-services-maps:9.0.0"
compile "com.google.android.gms:play-services-location:9.0.0"
compile "com.google.android.gms:play-services-auth:9.0.0"
compile "com.google.android.gms:play-services-identity:9.0.0"
// SUB-PROJECT DEPENDENCIES END
}
now, When I run my app it show error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
here is my SDK
Please help me to fix it. thank you very much !