Closed mmartinez23 closed 3 months ago
you shouldn't call registerPlugins
for plugins generated with this tool, that's for custom code "plugins" (plugins that live in your project, not in an external package.
Also, in case you call it, you should call it before the super.onCreate
, not after.
you shouldn't call
registerPlugins
for plugins generated with this tool, that's for custom code "plugins" (plugins that live in your project, not in an external package.Also, in case you call it, you should call it before the
super.onCreate
, not after.
Even if I remove it I get the same error, it is working fine on iOS, the only problem is Android and I can't seem to see where the problem is. Even if I use the function that comes with the generated Plugin, meaning echo, it still gives me the error but with "reading 'echo'" instead of the one I created.
You can ask on the Ionic forums or on github discussions
But without a sample app it's going to be hard to help you.
Posting this for future reference in case someone sees this. I managed to get it working with the latest release of the plugin. I did not managed to find what was causing the issue exactly, my theory is that is something caused by Visual Studio Code Intellisense, be sure to import it on the main app as "from "custom-plugin"", in my case it was importing it using "from "custom-plugin/src" and I was trying to use it like that.
Thank you @jcesarmobile for your time and help.
Hello,
I created a custom plugin which is working fine in iOS, but in Android I receive the error 'Cannot read properties of undefined (reading 'getDeviceVolume')'. I followed the guide and also tried a few things that I saw while Googling. Is there something I am missing?
Using @capacitor/plugin@0.12.0
My definitions.ts:
My index.ts:
VolumeGetterPlugin.java
MainActivity.java in main project:
app.ts in main project: