fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 999 forks source link

Cordova unable to build Android #241

Open nevaehph opened 7 years ago

nevaehph commented 7 years ago

Hi, I am currently developing an application using this plugin. Before I was using v1.1.4 and it was working fine. But when I removed the old plugin to add the new version, v2.1.1, the build failed, giving me the following error.

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

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.

From there I changed the project.properties file at value from: cordova.system.library.1=com.google.android.gms:play-services-location:+ to cordova.system.library.1=com.google.android.gms:play-services-location:9.0.0 as I assumed the situation to be the same as when I was using v1.1.4. But the following error came instead:

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.
C:\prototype\platforms\android\src\com\marianhello\bgloc\ActivityRecognitionLocationProvider.java:68: error: cannot access AbstractSafeParcelable
        if (lastActivity.getType() == DetectedActivity.STILL) {
                        ^
  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: Some input files use 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.

I tried removing and re-adding the plugin again and it did not work for me. At the moment I changed back to v1.1.4 but I would like to use the latest version that is available. Does anyone have a solution to this problem? Thanks in advance

Almya commented 7 years ago

Same here

carauzs commented 7 years ago

+1

3rand commented 7 years ago

+1

adelcasse commented 7 years ago

+1

paulinhamp commented 7 years ago

+1

KnightOfRealm commented 7 years ago

+1

martykan commented 7 years ago

Same problem here too

vabiro commented 7 years ago

Same here: using dk1.8.0_121.jdk, Android Studio 2.2.3,

in the project.properties file (which has been associated with earlier versions of this problem): target=android-24 android.library.reference.1=CordovaLib cordova.system.library.1=com.google.firebase:firebase-core:+ cordova.system.library.2=com.google.firebase:firebase-messaging:+ cordova.gradle.include.1=cordova-plugin-fcm/tfscad-FCMPlugin.gradle cordova.gradle.include.2=phonegap-plugin-push/tfscad-push.gradle cordova.system.library.3=com.android.support:support-v13:23+ cordova.system.library.4=com.google.android.gms:play-services-gcm:9.8+ cordova.system.library.5=me.leolin:ShortcutBadger:1.1.4@aar

andrewoodleyjr commented 7 years ago

+1

nabinkumarn commented 7 years ago

@nevaehph Have you found any solution to this other than using older version?

Almya commented 7 years ago

One solution is to stop using this plugin and use cordova-plugin-firebase instead

vabiro commented 7 years ago

I ended up switching to OneSignal for messaging

yushinarch commented 6 years ago

@nevaehph, i started a new project, added all the previous plugins i had, and updated them to the latest. update cordova engine to 7.1.0

i followed what you did by replacing

cordova.system.library.1=com.google.android.gms:play-services-location:11+ to cordova.system.library.1=com.google.android.gms:play-services-location:9.0.0

add them it compiled...

please not i added all the plugins with configuring anything in project...