This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Task :react-native-push-notification:compileDebugJavaWithJavac FAILED all of a sudden #1979
Copy link
Copy link
Closed
Description
Bug
Two projects that uses this library. But suddenly we can't build them on Android anymore.
Task :react-native-push-notification:compileDebugJavaWithJavac FAILED
It seems like other people are having this issue too. But it might be related to react-native-fcm.
evollu/react-native-fcm#1111 (comment)
Anyone know how to fix it?
Environment info
react-native info output:
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 82.62 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.8.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.2
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 15.0.1 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Library version: 7.2.3
Error:
> Task :react-native-push-notification:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
148 actionable tasks: 146 executed, 2 up-to-date
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-background-downloader/android/src/main/java/com/eko/RNBackgroundDownloaderModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/@react-native-community/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-fs/android/src/main/java/com/rnfs/RNFSManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
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.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-localize/android/src/main/java/com/reactcommunity/rnlocalize/RNLocalizeModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:39: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;
^
symbol: class FirebaseInstanceId
location: package com.google.firebase.iid
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:40: error: cannot find symbol
import com.google.firebase.iid.InstanceIdResult;
^
symbol: class InstanceIdResult
location: package com.google.firebase.iid
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:143: error: cannot find symbol
.addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
^
symbol: class InstanceIdResult
location: class RNPushNotification
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:145: error: cannot find symbol
public void onComplete(@NonNull Task<InstanceIdResult> task) {
^
symbol: class InstanceIdResult
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:142: error: cannot find symbol
FirebaseInstanceId.getInstance().getInstanceId()
^
symbol: variable FirebaseInstanceId
location: class RNPushNotification
/Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:289: error: cannot find symbol
FirebaseInstanceId.getInstance().deleteInstanceId();
^
symbol: variable FirebaseInstanceId
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/helenzhang/projects/akufen_icc_react-native/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors
3 warnings
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-push-notification:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Steps To Reproduce
- npx react-native run-android
Describe what you expected to happen:
- App should build successfully on Android
Reproducible sample code
Reacted by Gabriel Noriega, Catherine Korres, Rodrigo Lourenço, Zahid Mahmood, alexfov, Aiden Petersen, Emre Can ÖZKÖK, Okan SARICA, Amar, Ben London and 31 more
Reacted by TanveerSalman
Reacted by Zahid Mahmood, Catherine Korres, Emre Can ÖZKÖK, Gustavo Gialim, Letícia Rosa and Dragosh Cr
Reacted by Namsrai, Dmitry Ogurtsov and Dragosh Cr
Metadata
Metadata
Assignees
Labels
No labels
Activity
jeffbonasso-ambifi commentedon May 11, 2021
Getting the exact same errors. I built probably 50 times with no issue, and then suddenly on multiple build machines this error started occurring. Suspect not specifically in this library but a low-level dependency that was pushed.
catherinekorres commentedon May 11, 2021
I'm getting the same error, it started about an hour ago out of nowhere
lourencorodrigo commentedon May 11, 2021
Getting the same error here.
nikolaywithpara commentedon May 11, 2021
taltrui commentedon May 11, 2021
nikolaywithpara commentedon May 11, 2021
@taltrui I think none of us has fixed firebase messaging package version and firebase did new release with breaking changes
mir1198yusuf commentedon May 11, 2021
Is this the same error everyone facing ?
all of a sudden
react-native run-androidis failing due to thisjeffbonasso-ambifi commentedon May 11, 2021
emrecanozkok commentedon May 11, 2021
All Trace
iamamar11 commentedon May 11, 2021
emrecanozkok commentedon May 11, 2021
iamamar11 commentedon May 11, 2021
emrecanozkok commentedon May 11, 2021
iamamar11 commentedon May 11, 2021
mir1198yusuf commentedon May 12, 2021
49 remaining items
TalkyEk commentedon May 12, 2021
@Dallas62 unfortunately doesn't work for me
Dallas62 commentedon May 12, 2021
@TalkyEk Since this is a duplicate classes, you have a dependency in your Gradle File which is wrong, can't help more with information provided.
TalkyEk commentedon May 12, 2021
@Dallas62 thanks for help
sharpcodepro commentedon May 12, 2021
Getting the same, meh :(
dotansimha commentedon May 12, 2021
Please note my comment in #1979 (comment)
If
firebase-messagingis resolved to v22, you also get an error regarding duplicate classes, which seems to be the incorrect symptom.DennisOstertag commentedon May 12, 2021
thanks a lot. this fixed it for me
bhanu2795 commentedon May 12, 2021
@Dallas62 after upgrading it to 7.3.0 it worked for me the apk is created but as soon as the app is launched it get crashed below is the logcat screen shot

DivWal commentedon May 12, 2021
Task :app:checkDebugDuplicateClasses FAILED
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/ml-vision' depends on '@react-native-firebase/app' v8.3.1 but found v7.0.1, this might cause build issues or runtime crashes.
I updated the push-notification version @7.3.0.
Cannot try to pin messaging version, in android/build.gradle as i m using google-service not firebaseMessagingVersion.
Can anyone help me out with this ?
yasir-syed commentedon May 12, 2021
upgraded to 7.3.0 build is successful but app keeps on crashing on start up, no other changes made,
Dallas62 commentedon May 12, 2021
Dallas62 commentedon May 12, 2021
A new version
7.3.1is available to make you save time on the current issue (and side-effect).Maintainers are welcome ! contact me if interested in 😉