Hii all, while doing build getting this error, please help me, onNewToken() method is there in FirebasePluginMessagingService.java but still it is getting error as cannot find this method
D:\Toufiq\Tineri_Svn_Copy>cordova build android
cordova-android-firebase-gradle-release: Android platform: V7+
cordova-android-firebase-gradle-release: No custom version found in package.json
using plugin default
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version ‘27.1.0’ to D:\Touf
iq\Tineri_Svn_Copy\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version ‘27.1.0’ to D:\Touf
iq\Tineri_Svn_Copy\platforms\android\cordova-android-support-gradle-release\tine
ristaging-cordova-android-support-gradle-release.gradle
Android Studio project detected
cordova-android-firebase-gradle-release: Android platform: V7+
cordova-android-firebase-gradle-release: No custom version found in package.json
using plugin default
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version ‘27.1.0’ to D:\Touf
iq\Tineri_Svn_Copy\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version ‘27.1.0’ to D:\Touf
iq\Tineri_Svn_Copy\platforms\android\cordova-android-support-gradle-release\tine
ristaging-cordova-android-support-gradle-release.gradle
cordova-plugin-androidx: ERROR: EXCEPTION: Error: ENOENT: no such file or direct
ory, open ‘D:\Toufiq\Tineri_Svn_Copy\platforms\android\gradle.properties’
Preparing Firebase on Android
ANDROID_HOME=C:\Users\midhun\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_162
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now
published.
Configuration ‘compile’ in project ‘:app’ is deprecated. Use ‘implementation’ in
stead.
±----------------------------------------------------------------
| cordova-android-firebase-gradle-release: 15.+
±----------------------------------------------------------------
±----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.1.0
±----------------------------------------------------------------
The Task.leftShift(Closure) method has been deprecated and is scheduled to be re
moved in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_84njwjoq3t9wbeo12pbbsgxjf.run(D:\Toufiq\Tineri_Svn_Copy\platfor
ms\android\app\build.gradle:150)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollec
tion)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollec
tion)
: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-T
O-DATE
:app:cdvCreateAssetManifest
:app:preBuild
: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
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:processDebugGoogleServices
Parsing json file: D:\Toufiq\Tineri_Svn_Copy\platforms\android\app\google-servic
es.json
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavacD:\Toufiq\Tineri_Svn_Copy\platforms\android\app\sr
c\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:51:
error: cannot find symbol
super.onNewToken(refreshedToken);
^
symbol: method onNewToken(String)
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 ‘: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.
BUILD FAILED in 6s
(node:24736) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.
after long hours of searching, you saved my day!!! that’s the solution! The problem is the plugin cordova-plugin-firebase, because all described solutions above didn’t work for me. The fcm-plugin is now working really fine after 5mins of integration with the following tutorial:
Not my favorite guide, there was a lot of fluff unrelated to the push notifications.
HOWEVER out of the 3-4 guides i followed for getting push notifications rigged up this one is the first one to work!!