Closed psanxiao closed 3 years ago
I can only assume the plugin was not successfully registered. Maybe try running npx cap sync
and rebuilding.
Note that the plugin is not available on the web platform.
It seems the problem was it's necessary to import the plugin in the MainActivity java class by hand, despite of using capacitor to build the android App. It's working now so I'm closing the issue.
I'm developing an ionic app with React and capacitor (v2).
Installed this plugin as Readme said. Imported like:
and used as:
But I get this in execution:
capacitor-runtime.js:358 TypeError: Cannot read property 'addWatcher' of undefined at n.value (main.b2f4cf63.chunk.js:1) at n. (main.b2f4cf63.chunk.js:1)
at fo (4.cef1bb18.chunk.js:2)
at ps (4.cef1bb18.chunk.js:2)
at Du (4.cef1bb18.chunk.js:2)
at t.unstable_runWithPriority (4.cef1bb18.chunk.js:2)
at Ui (4.cef1bb18.chunk.js:2)
at Tu (4.cef1bb18.chunk.js:2)
at mu (4.cef1bb18.chunk.js:2)
at 4.cef1bb18.chunk.js:2
I think is related with issue #17 but it was closed without answer...