question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android build FAILED Task :react-native-push-notification:compileReleaseJavaWithJavac FAILED

See original GitHub issue

Bug

I’m currently having some issues building on android (maybe cause of the new release google has on may 11) I got this running ./gradlew :app:bundleRelease --warning-mode all

Task :react-native-push-notification:compileReleaseJavaWithJavac FAILED
Extending the JavaCompile task has been deprecated. This is scheduled to be removed in Gradle 7.0. Configure the task instead.
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:38: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceId;
                              ^
  symbol:   class FirebaseInstanceId
  location: package com.google.firebase.iid
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/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.InstanceIdResult;
                              ^
  symbol:   class InstanceIdResult
  location: package com.google.firebase.iid
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:122: error: cannot find symbol
              .addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
                                                            ^
  symbol:   class InstanceIdResult
  location: class RNPushNotification
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:124: error: cannot find symbol
                  public void onComplete(@NonNull Task<InstanceIdResult> task) {
                                                       ^
  symbol: class InstanceIdResult
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:121: error: cannot find symbol
      FirebaseInstanceId.getInstance().getInstanceId()
      ^
  symbol:   variable FirebaseInstanceId
  location: class RNPushNotification
/Users/imac/Desktop/TomateUnCafe/TomateUnCafe/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:268: error: cannot find symbol
                  FirebaseInstanceId.getInstance().deleteInstanceId();
                  ^
  symbol: variable FirebaseInstanceId
Note: /Users/imac/Desktop/TomateUnCafe/TomateUnCafe/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.
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-push-notification:compileReleaseJavaWithJavac'.
> 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 1m 33s

Environment info

react-native info output:

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-3470S CPU @ 2.90GHz
    Memory: 628.26 MB / 14.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 15.1.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 7.0.8 - /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.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK:
      API Levels: 23, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_272 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^16.13.1 => 16.14.0 
    react-native: 0.63.2 => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 6.1.3

Steps To Reproduce

  1. npx react-native run-android
  2. Occurs in the building section

Describe what you expected to happen:

  1. App builds

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

10reactions
Gyeopcommented, May 13, 2021

https://github.com/zo0r/react-native-push-notification/releases/tag/7.3.1

Check out the release notes. If you use 7.3.1 or higher, it will be fine.

1reaction
Dallas62commented, May 13, 2021

Please search in issue history before opening an issue! Regards #1979

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android - Build Failing · Issue #353 · software-mansion/react ...
Task :react-native-screens:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for ...
Read more >
Android Studio Build Failed - Task :app:dexBuilderDebug ...
There was a failure while executing work items > A failure occurred while executing com.android.build.gradle.internal.dexing.
Read more >
Android Build Failed! - Unity Forum
Execution failed for task ':launcher:mergeReleaseResources'. > Multiple task action failures occurred: > A failure occurred while executing com.
Read more >
Failed Builds - Visual Studio App Center - Microsoft Learn
In this article. If building works locally but not in App Center; Comparing different builds in App Center; Isolating and interpreting error ......
Read more >
React Native Android : FAILURE: Build failed with ... - A Shirazee
Execution failed for task ':app:compileDebugJavaWithJavac'. > Task :app:compileDebugJavaWithJavac FAILED. This is an issue with how Gradle is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found