ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
485 stars 563 forks source link

Can't build with push-notifications plulgin #1104

Closed FrenchGithubUser closed 1 year ago

FrenchGithubUser commented 1 year ago

Bug Report

Plugin(s)

"@capacitor/push-notifications": "^4.0.0"

Capacitor Version

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 3.6.0
  @capacitor/android: 3.6.0
  @capacitor/core: 3.6.0

Platform(s)

Android

Current Behavior

Building with command : quasar build -m capacitor -T android outputs this error (quasar project) :

> Task :capacitor-push-notifications:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':capacitor-push-notifications:compileReleaseJavaWithJavac'.
> invalid source release: 11

Expected Behavior

Build without errors

Additional Context

Before installing this plugin, everything was working correctly when building.

I followed this tutorial.

Dev with quasar dev on web still works though but with this error : Error: "PushNotifications" plugin is not implemented on web

And quasar dev for android gives this output :

src-capacitor/node_modules/@capacitor/push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java:3: error: package android.app does not exist import android.app.Notification;
jcesarmobile commented 1 year ago

Version 4.0.0 of the plugins are meant to be used with capacitor 4. You are still using capacitor 3. Keep using version 1.x of the plugin or migrate to capacitor 4, it’s really simple https://capacitorjs.com/docs/updating/4-0

FrenchGithubUser commented 1 year ago

I was not aware of that. Thanks !

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 the plugin, please create a new issue and ensure the template is fully filled out.