I encounter a problem adding a custom plugin by following the official tutorial here
From VSCode : mainActivity.java
“The method registerPlugin(Class) is undefined for the type MainActivityJava(67108964)”
If I try to launch the app with ionic cap run android, I get this error :
“node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\BridgeActivity.java:23: error: cannot find symbol
Does someone have a better tutorial than the official doc ?
What’s your Capacitor version?
I have the version 4.5.0
I started a new project instead of implementing this in my current one, and in worked fine.
I compared the dependancies versions and actually my older project had “@capacitor/cli”: “3.6.0” instead of 4.5.0, but the syntaxe was already that one, contrary to v2.
So, I’m not sure what changed but my problem is solved.
Also, don’t forget the imports not mentioned in the documentation :