ionic-team / capacitor

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

[Bug]: Custom Native iOS Code Plugin not Registered #7409

Closed abegehr closed 1 month ago

abegehr commented 1 month ago

Capacitor Version

πŸ’Š Capacitor Doctor πŸ’Š

Latest Dependencies:

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

Installed Dependencies:

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

[success] iOS looking great! πŸ‘Œ

Other API Details

npm: 10.5.1
node: 20.9.0
pod: 1.14.3

Platforms Affected

Current Behavior

I've followed the docs for adding custom native code to iOS: https://capacitorjs.com/docs/ios/custom-code - however the EchoPlugin is never called.

Expected Behavior

I would expect the EchoPlugin to load and be called. This doesn't occur even though I've followed the docs exactly.

Project Reproduction

https://github.com/abegehr/capacitor-sample/commit/08fc81759bdaebb4e516b4f6fe03eee4e0e9dc9c

Additional Information

After some digging, I found that plugins are registered in iOS based on the packageClassList parameter on the config json: https://github.com/ionic-team/capacitor/blob/5b2ab7c68db4e77b8b2961e927acc5a708ee260f/ios/Capacitor/Capacitor/CapacitorBridge.swift#L9 - however the generated config json has an empty list under packageClassList. I tried adding the plugin name under plugins on the src config file but no change. Manually adding "EchoPlugin" to packageClassList in the generated config json file works however the file is overwritten on the next sync.

jcesarmobile commented 1 month ago

closing as duplicate of https://github.com/ionic-team/capacitor-docs/issues/275

ionitron-bot[bot] commented 2 days 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.