I can't use Capacitor properties and methods

I am trying to use some methods and properties of Capacitor but none works in Android, if I try to get the platform with Capacitor.platform it returns “undefined” and it gives me an error if I try to use any method. What could it be?


Note: I tested the app on my cell phone with Android 9 using the command “ionic cap run android -l --external” and also with “ionic cap run android” but it still doesn’t work.

Can you please provide more context? whats does the code look like that you are trying to run? What are the imports?

You might want to check this reactjs - Capacitor Plugin shows as undefined on android build - Stack Overflow