Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':app:compileDebugJavaWithJavac'. #1090

Closed
dassram17 opened this issue Jul 5, 2019 · 1 comment
Closed

Execution failed for task ':app:compileDebugJavaWithJavac'. #1090

dassram17 opened this issue Jul 5, 2019 · 1 comment

Comments

@dassram17
Copy link

dassram17 commented Jul 5, 2019

Describe the bug
Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

To Reproduce
I created new project by "cordova create projnm com.site.appname projnm"

projnm -- added cordova-plugin-firebase by "cordova plugin add cordova-plugin-firebase"
projnm -- created android platform by "cordova platform add android"
projnm -- after created android platform build by 'cordova build android'
Shows an error -- Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.

Screenshots
If applicable, add screenshots to help explain your problem.

Console Logs
---------------------cmd consoles ---------------------
Preparing Firebase on Android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\ADMIN\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessManifest(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.

Task :app:preBuild UP-TO-DATE
Task :CordovaLib:preBuild UP-TO-DATE
Task :CordovaLib:preDebugBuild UP-TO-DATE
Task :CordovaLib:checkDebugManifest UP-TO-DATE
Task :CordovaLib:processDebugManifest UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :CordovaLib:compileDebugAidl NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
Task :CordovaLib:packageDebugRenderscript NO-SOURCE
Task :app:compileDebugRenderscript UP-TO-DATE
Task :app:checkDebugManifest UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:prepareLintJar UP-TO-DATE
Task :app:generateDebugSources UP-TO-DATE
Task :CordovaLib:compileDebugRenderscript UP-TO-DATE
Task :CordovaLib:generateDebugBuildConfig UP-TO-DATE
Task :CordovaLib:generateDebugResValues UP-TO-DATE
Task :CordovaLib:generateDebugResources UP-TO-DATE
Task :CordovaLib:packageDebugResources UP-TO-DATE
Task :CordovaLib:generateDebugRFile UP-TO-DATE
Task :CordovaLib:prepareLintJar UP-TO-DATE
Task :CordovaLib:generateDebugSources UP-TO-DATE
Task :CordovaLib:javaPreCompileDebug UP-TO-DATE
Task :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
Task :CordovaLib:processDebugJavaRes NO-SOURCE
Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:mainApkListPersistenceDebug UP-TO-DATE
Task :app:mergeDebugShaders UP-TO-DATE
Task :app:compileDebugShaders UP-TO-DATE
Task :app:generateDebugAssets UP-TO-DATE
Task :CordovaLib:mergeDebugShaders UP-TO-DATE
Task :CordovaLib:compileDebugShaders UP-TO-DATE
Task :CordovaLib:generateDebugAssets UP-TO-DATE
Task :CordovaLib:packageDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:fabricGenerateResourcesDebug
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:mergeDebugResources
Task :app:processDebugResources
BUILD FAILED in 2s
Task :app:compileDebugJavaWithJavac FAILED
31 actionable tasks: 4 executed, 27 up-to-date
---------------------------projnm\platforms\android\gradlew: Command failed with exit code 1 Error output:
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:9: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
^
symbol: class NotificationManagerCompat
location: package android.support.v4.app
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:6: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceIdService;
^
symbol: class FirebaseInstanceIdService
location: package com.google.firebase.iid
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:8: error: cannot find symbol
public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService {
^
symbol: class FirebaseInstanceIdService
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:11: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
^
symbol: class NotificationCompat
location: package android.support.v4.app
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:370: error: cannot find symbol
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
^
symbol: class NotificationManagerCompat
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:370: error: cannot find symbol
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
^
symbol: variable NotificationManagerCompat
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:610: error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types;
: FirebaseRemoteConfig.getInstance().getByteArray(key, namespace);
^
required: String
found: String,String
reason: actual and formal argument lists differ in length
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:629: error: method getValue in class FirebaseRemoteConfig cannot be applied to given types;
: FirebaseRemoteConfig.getInstance().getValue(key, namespace);
^
required: String
found: String,String
reason: actual and formal argument lists differ in length
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:686: error: no suitable method found for setDefaults(Map<String,Object>,String)
FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace);
^
method FirebaseRemoteConfig.setDefaults(Map<String,Object>) is not applicable
(actual and formal argument lists differ in length)
method FirebaseRemoteConfig.setDefaults(int) is not applicable
(actual and formal argument lists differ in length)
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:885: error: cannot find symbol
myTrace.incrementCounter(counterNamed);
^
symbol: method incrementCounter(String)
location: variable myTrace of type Trace
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:17: error: method does not override or implement a method from a supertype
@OverRide
^
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:128: error: package NotificationCompat does not exist
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
^
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:128: error: package NotificationCompat does not exist
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, channelId);
^
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:137: error: cannot find symbol
.setPriority(NotificationCompat.PRIORITY_MAX);
^
symbol: variable NotificationCompat
location: class FirebasePluginMessagingService
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:133: error: package NotificationCompat does not exist
.setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody))
^
---------------------------projnm\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginMessagingService.java:132: error: cannot find symbol
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
^
symbol: variable NotificationCompat
location: class FirebasePluginMessagingService
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
16 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app: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. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s.
------------------------------Above is cmd console output--------------

Plugin Version

  • cordova-plugin-firebase 2.0.5
  • Android version android 8.0.0
  • Android studio version 3.4.1
  • Cordova version 9.0.0

Additional context
Looking for the solution for last three days.. Please anyone have same error or got any solution suggest me.. Thank you!.

@dassram17
Copy link
Author

dassram17 commented Jul 11, 2019

Error resolved in #1081 (comment) --- By using this solution i can't open my app..
After i tried with https://github.com/dpa99c/cordova-plugin-firebase plugin it worked great!. Thank you so much for this plugin creator..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant