cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Conflict with cordova-plugin-firebasex

Open re2005 opened this issue 5 years ago • 1 comments

Your Environment

  • Plugin version: 0.9.0-beta.3
  • Platform: Android
  • Cordova version (cordova -v): 9.0.0
  • Cordova platform version (cordova platform ls): android 8.1.0

Expected Behavior

Combine both plugins and build the APK, have local notifications and google analytics.

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

cordova create helloNotifications cordova plugin add cordova-plugin-local-notification cordova plugin add cordova-plugin-firebasex cordova platform add android cordova run android --device

Context

Have local notifications and add google analytics

Debug logs

37 actionable tasks: 12 executed, 25 up-to-date D8: Cannot fit requested classes in a single dex file (# methods: 91487 > 65536)

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

  • 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 5s .../helloNotifications/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. D8: Cannot fit requested classes in a single dex file (# methods: 91487 > 65536)

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

  • 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 5s

re2005 avatar Apr 22 '20 19:04 re2005

Hi @dpa99c @re2005 @katzer I want to use both cordova-plugin-firebasex and cordova-plugin-local-notification plugin and there is a conflict having them together.

I followed these steps in the order shown cordova create firebaselocal cordova plugin add cordova-plugin-local-notification cordova plugin add cordova-plugin-firebasex cordova platform add android cordova run android --device

I made all the necessary modifications to the two build.gradle and to the config.xml and copied the google-services.json in app folder cordova 10.0.0 cordova android 9.1.0 cordova-plugin-badge 0.8.8 "Badge" cordova-plugin-device 2.0.3 "Device" cordova-plugin-firebasex 12.1.0 "Google Firebase Plugin" cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification" cordova-plugin-whitelist 1.3.4 "Whitelist" Gradle 6.5

When executing the build command or the run command it shows these errors

Task :app:compileDebugJavaWithJavac FAILED C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Notification.java:33: error: cannot find symbol import android.support.v4.app.NotificationCompat; ^ symbol: class NotificationCompat location: package android.support.v4.app C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Notification.java:34: error: package android.support.v4.util does not exist import android.support.v4.util.ArraySet; ^ C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Notification.java:35: error: package android.support.v4.util does not exist import android.support.v4.util.Pair; ^ ... ... ...

C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Builder.java:368: error: package NotificationCompat.Action does not exist btn = new NotificationCompat.Action.Builder( ^ C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Builder.java:414: error: package NotificationCompat does not exist NotificationCompat.Builder builder = Notification.getCachedBuilder(key); ^ C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\de\appplant\cordova\plugin\notification\Builder.java:417: error: package NotificationCompat does not exist builder = new NotificationCompat.Builder(context, options.getChannel()); ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 96 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 39s 28 actionable tasks: 28 executed Command failed with exit code 1: C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\gradlew cdvBuildDebug -b C:\xampp\htdocs\phonegap\firebaselocal\platforms\android\build.gradle

The root folder of the project is firebaselocal

If I use the plugins separately they work fine but together in the same project it returns the errors

I hope and appreciate the help you can give me. Daniel.

danielpa70 avatar May 15 '21 20:05 danielpa70