question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Plugins stop working after re-compilation

See original GitHub issue

Bug Report

Capacitor Version

npx cap doctor output: 💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 2.0.2

@capacitor/core: 2.0.2

@capacitor/android: 2.0.2

@capacitor/electron: 2.0.2

@capacitor/ios: 2.0.2

Installed Dependencies:

@capacitor/electron not installed

@capacitor/cli 2.0.0

@capacitor/android 2.0.0

@capacitor/ios 2.0.0

@capacitor/core 2.0.0

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

Whenever I re-compile my app ionic capacitor copy there is a ~40% chance that all my plugins stop working. The Plugins I’m currently using are [Device, PushNotifications, Storage, SplashScreen, and AdMob].

When I say stop working, there are two specific cases in mind:

  1. For PushNotifications, no callbacks are ever fired, I call PushNotifications.register();, but PushNotifications.addListener('registration') nor any other listener fire.
  2. More on PushNotifications, if the register callback is triggered, sometimes both foreground and background notifications continue to work, other times only background notifications work.
  3. For Storage, I call Storage.set() and it never even saves the value to memory.

I specifically notice this starts getting buggy when I install new npm packages or clear the cache of XCode or Android Studio.

Expected Behavior

After successfully confirming Plugins like PushNotifications and Storage work in iOS/Android… rebuilding the project with ionic capacitor copy should not stop Plugins from working.

If I clear my cache in XCode or Android Studio, I’d expect running npx cap sync && cd ios/app && pod install && cd ../../ && ionic capacitor copy should get everything re-synced and working again.

I’d even optionally add: rm -rf ./node_modules && npm install before the commands above, but that still seems to be flaky.

Sample Code or Sample Application Repo

Reproduction Steps

I made a Github Repo where you can clone an MVP of testing device, storage, and push-notification plugins. The README has all steps to setup and test.

In this demo repo:

  • Device plugin works in web + iOS + Android
  • Storage plugin only works in web
  • Push Notification plugin doesn’t work on iOS (register callback never triggered)

Other Technical Details

npm --version output: 6.11.3 node --version output: v12.11.1 pod --version output (iOS issues only): 1.9.1

Other Information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ryantinkercommented, May 15, 2020

Okay I think I found the problem. It was something with my APNs certificates/keys.

I believe the certificate being used in my iOS app was not the same certificate that Firebase was using (Firebase uses keys).

I re-created some keys and certificates, reuploaded them all, and it finally works.

0reactions
ionitron-bot[bot]commented, Nov 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem - Continually compiling plugins - Tenable Community
It seems to be trying to compile plugins but having read on the forums, this is a known issue. I have tried to...
Read more >
Problems to recompile a UE4 plugin - unreal engine4
My guess since it looks to be an old plugin it probably improperly ... This error is actually what's causing you not to...
Read more >
Recompiled plugins not refreshing in Unity - Unity Answers
My problem seems to be that when recompiling and copying the bundle into the Assets/Plugins folder Unity doesn't pick up the new versions ......
Read more >
Build plugin prevent to use incremental compilation when ...
I tested incremental compilation with annotation processors supported since Gradle 7. I'm using annotation processor that support this feature already.
Read more >
The Java Plugin - Gradle User Manual
The Java plugin adds Java compilation along with testing and bundling ... task does not use incremental build immediately after a compile error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found