Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility problems between phonegap-plugin-push 2.2.2 and cordova-plugin-request-location-accuracy using Cordova 8 and [email protected] #50

Closed
djkad opened this issue May 17, 2018 · 6 comments

Comments

@djkad
Copy link

djkad commented May 17, 2018

No description provided.

@dpa99c
Copy link
Owner

dpa99c commented May 17, 2018

When using this plugin with phonegap-plugin-push, the Play Services library version used by both plugins must be aligned.
However, recently there's also a new requirement that the major version of the Play Services library must align with the major version of Firebase, hence both must be overriden.

It took the creation of a new plugin to resolve this (cordova-android-firebase-gradle-release) but there's now a working solution.
Using the new plugin plus cordova-android-play-services-gradle-release, the versions specified by this plugin and phonegap-plugin-push can be aligned to make the build succeed:

cordova plugin add cordova-android-play-services-gradle-release  --variable PLAY_SERVICES_VERSION=15.+
cordova plugin add cordova-android-firebase-gradle-release  --variable FIREBASE_VERSION=15.+
cordova build android

See below for confirmation:

console output

$ cordova -v
8.0.0

$ cordova create test && cd test
Creating a new cordova project.

$ cordova plugin add [email protected]
Adding phonegap-plugin-push to package.json
Saved plugin info for "phonegap-plugin-push" to config.xml

$ cordova plugin add [email protected]
Adding cordova-plugin-request-location-accuracy to package.json
Saved plugin info for "cordova-plugin-request-location-accuracy" to config.xml

$ cordova platform add [email protected]
Using cordova-fetch for [email protected]
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: io.cordova.hellocordova
        Name: HelloCordova
        Activity: MainActivity
        Android target: android-27
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Android Studio project detected
Android Studio project detected
Installing "cordova-plugin-request-location-accuracy" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "phonegap-plugin-push" for android
Subproject Path: CordovaLib
Subproject Path: app
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous
platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~7.1.0 into config.xml file ...

$ cp ../google-services.json platforms/android/app/

$ cordova build android
Android Studio project detected
ANDROID_HOME=G:\Users\dpa99\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_3c73skfualp0fpq2g3nwd1gno.run(D:\Temp\test\platforms\android\app\build.gradle:144)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: D:\Temp\test\platforms\android\app\google-services.json
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavacD:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\FCMService.java:74: error: cannot access zzbej
    String from = message.getFrom();
                         ^
  class file for com.google.android.gms.internal.zzbej not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
 FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app: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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


28 actionable tasks: 11 executed, 17 up-to-date
BUILD FAILED in 9s
(node:18812) UnhandledPromiseRejectionWarning: 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.
D:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\FCMService.java:74: error: cannot access zzbej    String from = message.getFrom();
                         ^
  class file for com.google.android.gms.internal.zzbej not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.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 ':app: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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
Picked up _JAVA_OPTIONS: -Xms256m -Xmx4096m
    at ChildProcess.whenDone (D:\Temp\test\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:18812) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18812) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


$ cordova plugin add cordova-android-play-services-gradle-release  --variable PLAY_SERVICES_VERSION=15.+
Installing "cordova-android-play-services-gradle-release" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
cordova-android-play-services-gradle-release: Android platform: cordova-android@7
cordova-android-play-services-gradle-release: No custom version found in config.xml - using plugin default
Adding cordova-android-play-services-gradle-release to package.json
Saved plugin info for "cordova-android-play-services-gradle-release" to config.xml

$ cordova plugin add cordova-android-firebase-gradle-release  --variable FIREBASE_VERSION=15.+
Installing "cordova-android-firebase-gradle-release" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
cordova-android-firebase-gradle-release: Android platform: cordova-android@7
cordova-android-firebase-gradle-release: No custom version found in config.xml - using plugin default
Adding cordova-android-firebase-gradle-release to package.json
Saved plugin info for "cordova-android-firebase-gradle-release" to config.xml

$ cordova build android
cordova-android-firebase-gradle-release: Android platform: cordova-android@7
cordova-android-firebase-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\build.gradlecordova-android-firebase-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\cordova-android-firebase-gradle-release\properties.gradle
cordova-android-play-services-gradle-release: Android platform: cordova-android@7
cordova-android-play-services-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\cordova-android-play-services-gradle-release\properties.gradle
Android Studio project detected
cordova-android-firebase-gradle-release: Android platform: cordova-android@7
cordova-android-firebase-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\build.gradlecordova-android-firebase-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\cordova-android-firebase-gradle-release\properties.gradle
cordova-android-play-services-gradle-release: Android platform: cordova-android@7
cordova-android-play-services-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\build.gradle
cordova-android-play-services-gradle-release: Wrote custom version '15.+' to D:\Temp\test\platforms\android\app\cordova-android-play-services-gradle-release\properties.gradle
ANDROID_HOME=G:\Users\dpa99\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
+-----------------------------------------------------------------
| cordova-android-play-services-gradle-release: 15.+
+-----------------------------------------------------------------
+-----------------------------------------------------------------
| cordova-android-firebase-gradle-release: 15.+
+-----------------------------------------------------------------
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_3c73skfualp0fpq2g3nwd1gno.run(D:\Temp\test\platforms\android\app\build.gradle:146)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: D:\Temp\test\platforms\android\app\google-services.json
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug

:app:transformClassesWithDexBuilderForDebug
:app:transformClassesWithMultidexlistForDebug
:app:transformDexArchiveWithDexMergerForDebug
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug
:CordovaLib:transformNativeLibsWithStripDebugSymbolForDebug
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
:app:mergeDebugJniLibFolders
:app:transformNativeLibsWithMergeJniLibsForDebug
:app:transformNativeLibsWithStripDebugSymbolForDebug
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateSigningDebug
:app:packageDebug
:app:assembleDebug
:app:cdvBuildDebug

BUILD SUCCESSFUL in 16s
49 actionable tasks: 28 executed, 21 up-to-date
Built the following apk(s):
        D:\Temp\test\platforms\android\app\build\outputs\apk\debug\app-debug.apk

@zahersi
Copy link

zahersi commented Jul 14, 2018

hi @dpa99c I tried it with cordova-plugin-firebase but it still give build errors:
platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:129: error: constructor Builder in class Builder cannot be applied to given types; NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId); ^ required: Context found: FirebasePluginMessagingService,String reason: actual and formal argument lists differ in length

please help

@cikcoh
Copy link

cikcoh commented Jul 30, 2018

Hi, i'm using both fcm-plugin and googleplus-plugin

i have installed;
cordova plugin add cordova-android-firebase-gradle-release --variable FIREBASE_VERSION=9.0.0
cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=9.0.0

but still have error;
Found com.google.android.gms:play-services-auth:11.8.0, but version 9.0.0 is needed for the google-services plugin.
Found com.google.android.gms:play-services-identity:11.8.0, but version 9.0.0 is needed for the google-services plugin.

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.

@cquezpro
Copy link

I got same error. any news for this issue?

@cikcoh
Copy link

cikcoh commented Oct 13, 2018

@sirius2013 hi, have u tried solution from this link? https://code.i-harness.com/en/q/25fd238
it works for me. Besides that, i'm not using fcm-plugin anymore, i'm using phonegap-plugin-push, a lot of users said that it's more stable.

@andersondesigner3d
Copy link

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

what should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants