ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚑️
https://capacitorjs.com
MIT License
11.45k stars 977 forks source link

bug: Capacitor Push Notifications Plugin Not Found (Android) #5088

Closed AdlerJS closed 2 years ago

AdlerJS commented 2 years ago

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.2.4
  @capacitor/core: 3.2.4
  @capacitor/android: 3.2.4
  @capacitor/ios: 3.2.4

Installed Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

[success] iOS looking great! πŸ‘Œ
[success] Android looking great! πŸ‘Œ

Platform(s)

Android

Current Behavior

Currently my Capacitor application will compile and work as normal. However, when trying to add the @capacitor/push-notifications plugin the following error appears

E/Capacitor: Error loading plugins.
    com.getcapacitor.PluginLoadException: Could not find class by class path: com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin

Removing the plugin and running npx cap sync results in a successful build.

Expected Behavior

npm installing @capacitor/push-notifications and running npx cap sync should result in a successful android build and the plugin should function like other capacitor plugins in this instance.

Other Technical Details

npm --version output: 6.14.12

node --version output: v12.22.1

pod --version output (iOS issues only): N/A

Additional Context

Following this thread: https://forum.ionicframework.com/t/ionic-capacitor-pushnotifications-plugin-is-not-implemented-on-android/214972/4 I was able to resolve the push notification build issue, however, this forces us to manually add / manage all plugins in the MainActivity by implementing the suggested solution. For future maintenance of the project I would like to avoid this if possible.

Ionitron commented 2 years ago

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks! Ionitron πŸ’™

AdlerJS commented 2 years ago

Turns out this was an error in our custom build pipeline process and not in the plugin itself. Closing issue.

ionitron-bot[bot] commented 1 year ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.