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.

Execution failed for task ':react-native-push-notification:compileReleaseJavaWithJavac'

See original GitHub issue

Hi,

I’m sorry if this has been resolved already, but I’ve been stuck with this for a while now. I’ve installed the package, and did the link as per the README. Added the extra info in the AndroidManifest.xml after doing a link. I even tried to install the package and do a manual installation for android. It keeps failing to build.

My build.gradle looks like this

defaultConfig { applicationId "exampleProject" minSdkVersion 16 targetSdkVersion 22 versionCode 1 versionName "1.0" ndk { abiFilters "armeabi-v7a", "x86" } }

The error that I get is:

:react-native-push-notification:compileReleaseJavaWithJavac
:react-native-push-notification:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:7: error: cannot find symbol
import android.app.NotificationChannel;
                  ^
  symbol:   class NotificationChannel
  location: package android.app
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:162: error: constructor Builder in class Builder cannot be applied to given types;
            NotificationCompat.Builder notification = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
                                                      ^
  required: Context
  found: Context,String
  reason: actual and formal argument lists differ in length
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:480: error: cannot find symbol
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
                                                       ^
  symbol:   variable O
  location: class VERSION_CODES
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:488: error: cannot find symbol
        int importance = NotificationManager.IMPORTANCE_DEFAULT;
                                            ^
  symbol:   variable IMPORTANCE_DEFAULT
  location: class NotificationManager
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:489: error: cannot find symbol
        NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, name, importance);
        ^
  symbol:   class NotificationChannel
  location: class RNPushNotificationHelper
/Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java:489: error: cannot find symbol
        NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, name, importance);
                                          ^
  symbol:   class NotificationChannel
  location: class RNPushNotificationHelper
Note: /Users/umair/Desktop/Projects/*****/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/helpers/ApplicationBadgeHelper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors
:react-native-push-notification:compileReleaseJavaWithJavac FAILED

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.

Any help or suggestions would be greatly appreciated. Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:20
  • Comments:36 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
GabrielScalicicommented, Aug 29, 2018

after manual link on android, install older version with “npm install --save react-native-push-notification@2.0.1” fixed Javac issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Execution failed for task - React Native - Stack Overflow
when I try to build the applications using react-native run-android the build fails. Here is the output of the error that occurs. FAILURE:...
Read more >
Android studio | Execution failed for task - YouTube
Here, given trick to solve this type of error. Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for ...
Read more >
Android Gradle Build Fails With "execution Failed For Task
Trying to make an Android build and a little unsure what exactly is going on with this error. Could use any suggestions anyone...
Read more >
React-Native Execution failed for task :app:packageDebug
I ran "react-native run-ios". This may be the reason. Task :app:packageDebug FAILED. Deprecated Gradle features were used in this anycodings_android build, ...
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