error: cannot find symbol import android.app.NotificationChannel;
See original GitHub issueError at build time
Your Environment
- Plugin version: 0.9.0-beta.1
- Platform: Android
- OS version: Android
- Device manufacturer / model: AVD and LeEco 2
- Cordova version (
cordova -v
): 7.0.1, 7.1.1 - Cordova platform version (
cordova platform ls
): Android 4.4, 5.0, 6.1
Steps to Reproduce
- cordova create hello
- cd hello
- cordova platform add android
- cordova run android OK
- cordova plugin add cordova-plugin-splashscreen
- cordova run android OK
- cordova plugin add cordova-plugin-local-notification
- cordova run android ERROR
Debug logs
`ANDROID_HOME=H:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_cx9qy3b4evn7wp86k28qfcrpr.run(H:\Git\hello\platforms\android\build.gradle:139)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareAndroidArchLifecycleRuntime100Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2610Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2610Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2610Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2610Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2610Library UP-TO-DATE
:prepareComAndroidSupportSupportV42610Library UP-TO-DATE
:prepareMeLeolinShortcutBadger1119Library UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:24: error: cannot find symbol
import android.app.NotificationChannel;
^
symbol: class NotificationChannel
location: package android.app
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:41: error: cannot find symbol
import static android.os.Build.VERSION_CODES.O;
^
symbol: static O
location: class
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:109: error: cannot find symbol
if (SDK_INT < O)
^
symbol: variable O
location: class Manager
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:112: error: cannot find symbol
NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID);
^
symbol: class NotificationChannel
location: class Manager
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:112: error: cannot find symbol
NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID);
^
symbol: method getNotificationChannel(String)
location: variable mgr of type NotificationManager
H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:117: error: cannot find symbol
channel = new NotificationChannel(
^
symbol: class NotificationChannel
location: class Manager
Note: H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\localnotification\TriggerReceiver.java uses or overrides a deprecated API.
:compileDebugJavaWithJavac FAILED
Note: Recompile with -Xlint:deprecation for details.
6 errors
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘: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
Total time: 2.694 secs Error: cmd: Command failed with exit code 1 Error output: H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:24: error: cannot find symbol import android.app.NotificationChannel; ^ symbol: class NotificationChannel location: package android.app H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:41: error: cannot find symbol import static android.os.Build.VERSION_CODES.O; ^ symbol: static O location: class H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:109: error: cannot find symbol if (SDK_INT < O) ^ symbol: variable O location: class Manager H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:112: error: cannot find symbol NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID); ^ symbol: class NotificationChannel location: class Manager H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:112: error: cannot find symbol NotificationChannel channel = mgr.getNotificationChannel(CHANNEL_ID); ^ symbol: method getNotificationChannel(String) location: variable mgr of type NotificationManager H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\notification\Manager.java:117: error: cannot find symbol channel = new NotificationChannel( ^ symbol: class NotificationChannel location: class Manager Note: H:\Git\hello\platforms\android\src\de\appplant\cordova\plugin\localnotification\TriggerReceiver.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 ‘: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.`
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:11 (1 by maintainers)
Top GitHub Comments
tired of ionic
Closing since its a duplication. You need the lastest SDK to compile the plugin code even your runtime SDK is lower.