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.

Getting error when I try to build after using this plugin

See original GitHub issue

WARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.

Your Environment

  • Plugin version:0.9.0-beta.2
  • Platform:Android
  • OS version:Mac
  • Device manufacturer / model:
  • Cordova version (cordova -v):7.1.0
  • Cordova platform version (cordova platform ls):android 6.2.3
  • Plugin config
  • Ionic Version (if using Ionic):2.2.2

Expected Behavior

Tell us what should happen I installed the plugin using instructions given here: https://ionicframework.com/docs/native/local-notifications/ When I run the build I get below error

Actual Behavior

Tell us what happens instead

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:25: error: cannot find symbol

import android.app.NotificationChannel; ^ symbol: class NotificationChannel location: package android.app

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:32: error: package android.support.v4.media.app.NotificationCompat does not exist

import android.support.v4.media.app.NotificationCompat.MediaStyle; ^

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:43: error: cannot find symbol

import static android.os.Build.VERSION_CODES.O; ^ symbol: static O location: class

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:112: error: cannot find symbol

    if (SDK_INT < O)
                  ^

symbol: variable O location: class Manager

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:115: error: cannot find symbol

    NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID);
    ^

symbol: class NotificationChannel location: class Manager

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:115: error: cannot find symbol

    NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID);
                                     ^

symbol: method getNotificationChannel(String) location: variable mgr of type NotificationManager

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:120: error: cannot find symbol

    channel = new NotificationChannel(
                  ^

symbol: class NotificationChannel location: class Manager

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:130: error: cannot find symbol .setChannelId(options.getChannel()) ^

symbol: method setChannelId(String) location: class Builder

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:296: error: cannot find symbol

    MediaStyle style;
    ^

symbol: class MediaStyle location: class Builder

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:298: error: cannot find symbol style = new MediaStyle(builder)

                ^

symbol: class MediaStyle location: class Builder

/my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:417: error: constructor Builder in class Builder cannot be applied to given types;

        builder = new NotificationCompat.Builder(context, options.getChannel());
                  ^

required: Context found: Context,String

reason: actual and formal argument lists differ in length

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.

11 errors

:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘: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.

BUILD FAILED

Total time: 11.407 secs

Error: /my-project/platforms/android/gradlew: 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. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:25: error: cannot find symbol import android.app.NotificationChannel; ^ symbol: class NotificationChannel location: package android.app /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:32: error: package android.support.v4.media.app.NotificationCompat does not exist import android.support.v4.media.app.NotificationCompat.MediaStyle; ^ /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:43: error: cannot find symbol import static android.os.Build.VERSION_CODES.O; ^ symbol: static O location: class /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:112: error: cannot find symbol if (SDK_INT < O) ^ symbol: variable O location: class Manager /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:115: error: cannot find symbol NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID); ^ symbol: class NotificationChannel location: class Manager /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:115: error: cannot find symbol NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID); ^ symbol: method getNotificationChannel(String) location: variable mgr of type NotificationManager /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Manager.java:120: error: cannot find symbol channel = new NotificationChannel( ^ symbol: class NotificationChannel location: class Manager /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:130: error: cannot find symbol .setChannelId(options.getChannel()) ^ symbol: method setChannelId(String) location: class Builder /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:296: error: cannot find symbol MediaStyle style; ^ symbol: class MediaStyle location: class Builder /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:298: error: cannot find symbol style = new MediaStyle(builder) ^ symbol: class MediaStyle location: class Builder /my-project/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:417: error: constructor Builder in class Builder cannot be applied to given types; builder = new NotificationCompat.Builder(context, options.getChannel()); ^ required: Context found: Context,String reason: actual and formal argument lists differ in length 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. 11 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘: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.

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

  1. Install the @ionic-native/local-notification
  2. run ionic build

Context

What were you trying to do?

Debug logs

Include iOS / Android logs

  • ios XCode logs
  • Android: $ adb logcat

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:22

github_iconTop GitHub Comments

6reactions
Tawpiecommented, May 25, 2018

oh. I forgot to mention the critical step 10.

  1. Cross your fingers, find your lucky charm and hold it close to your left ear then turn around clockwise three times. With your eyes still closed, reverently face your computer and chant (softly): “oh mighty machine”. Bowing down to the computer is optional. Then run cordova build android
1reaction
mnwer595commented, May 24, 2020

l faced the same error !!! any help

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the "There Has Been a Critical Error on Your ...
The quickest way to fix the problem is to roll back your website if you have a backup, but there are a variety...
Read more >
How To Fix Your WordPress Site After A Plugin Update Goes ...
Wanna know how to fix WordPress after a plugin update went wrong? Search no more.In this video, I'm going to give you a...
Read more >
error while trying to add new plugin - WordPress.org
The loopback request to your site failed, this means features relying on them are not currently working as expected. Error encountered: (0) cURL...
Read more >
There Has Been a Critical Error on This Website: 5 Quick Fixes
A critical error can be frustrating. Learn how to fix "There has been a critical error on your website" error using five different...
Read more >
Failed to apply plugin [id 'com.android.application']
In my app there is no error in code but when I try to run my project it gives following errors. Error:(1, 1)...
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