capacitor-firebase-auth: Not compiling in Android Studio / capacitor.config.json cannot be read
\baumblatt\capacitor\firebase\auth\CapacitorFirebaseAuth.java:50: error: non-static method getArray(String,String[]) cannot be referenced from a static context String[] providers = Config.getArray(CONFIG_KEY_PREFIX+"providers", new String[0]); ^
I made sure I have the capacitor.config.json set up properly, why is this happening?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 15 (1 by maintainers)
constructor Config in class Config cannot be applied to given types; this.config = new Config(this.bridge.getActivity().getAssets(), null); ^ required: no arguments found: AssetManager,<null> reason: actual and formal argument lists differ in length
Hello,
The PR #95 was merged and released, i will close this and mark as duplicated.
Best Regards, Bernardo Baumblatt.
@alexx855 The workaround listed here will work to fix your issue - it’s the same issue I was seeing. The only thing you have to do, in additional to hard-coding the config values, is remove/comment out the
new Config()
constructor call. That instance is only used for thethis.config.get...
calls that don’t seem to be working.The plugin is working as expected for me now that I’ve removed that constructor and hard-coded the values.
You flippin LEGEND! Thank you so much
For example, instead of:
String[] providers = this.config.getArray(CONFIG_KEY_PREFIX+"providers", new String[0]);
this.nativeAuth = this.config.getBoolean(CONFIG_KEY_PREFIX+"nativeAuth", false);
String languageCode = this.config.getString(CONFIG_KEY_PREFIX+"languageCode", "en");
You should type:
String[] providers = {"google.com",};
this.nativeAuth = true;
String languageCode = "en"
I have the same problem and I am sure that the problem is here. Somehow the plugin configuration cannot be read from capacitor.config.json …
https://github.com/baumblatt/capacitor-firebase-auth/blob/0885aa6cd5247a675f9a0d0cdc1f3f4c1a62e64e/android/src/main/java/com/baumblatt/capacitor/firebase/auth/CapacitorFirebaseAuth.java#L56