capacitor-firebase-auth icon indicating copy to clipboard operation
capacitor-firebase-auth copied to clipboard

The provider is disable or unsupported

Open maikelsgit opened this issue 4 years ago • 8 comments

I'm have trouble understanding the following error:

vendor-es2015.js:41309 ERROR Error: The provider is disable or unsupported at Object.fromNative (capacitor-runtime.js:226) at :1:18

I have followed the install instructions and did the 'Add Firebase to your Android project' instructions. I also created and setup a SHA-1 fingerprint and enabled the Google Sign in method in the firebase console.

The code i'm using:

import {User} from 'firebase/app' import {cfaSignInGoogle} from 'capacitor-firebase-auth';

ngOnInit() { cfaSignInGoogle().subscribe((user: User) => { console.log(user.displayName); }); }

maikelsgit avatar Jun 17 '20 17:06 maikelsgit

Hello @Jarvey ,

Please double check your capacitor.config.json, there is some needed configurations documented in topic 1 here.

Best regards,
Bernardo Baumblatt

baumblatt avatar Jun 21 '20 17:06 baumblatt

Hi, I have the same issue in iOS but I couldn't find the capacitor.config.json, could you please provide some help or any update about this issue? Thank you. Have a nice day

SupineDread avatar Aug 24 '20 05:08 SupineDread

Hi @SupineDread ,

This file is part of your web project, and is the main configuration file of Capacitor Framework. You should find it at the root of your project directory.

Best regards, Bernardo Baumblatt

baumblatt avatar Aug 24 '20 12:08 baumblatt

Having the same issue on Android. This is what my capacitor.config.json looks like (I only require phone auth):

    "plugins": {
      "CapacitorFirebaseAuth": {
        "providers": [
          "phone"
        ],
        "languageCode": "en",
        "nativeAuth": false,
        "permissions": {}
      }
    }

capacitor-firebase-auth: 2.3.2 @capacitor/core: 2.4.0 @capacitor/android: 2.4.0

This happens with both cfaSignIn('phone', {phone: xxx}) and cfaSignInPhone(phoneNumber).

I've also enabled Phone authentication in Firebase, as well as setup the SHA-1 hash in the firebase console

ntkzwane avatar Aug 27 '20 19:08 ntkzwane

Make sure is the same file in the Android and iOS project and check for versions and specific configurations.

SupineDread avatar Aug 27 '20 20:08 SupineDread

Make sure is the same file in the Android and iOS project and check for versions and specific configurations.

I'm not sure I understand this 🙈. Which file in both android and ios projects? And check versions of what? And which specific configuration.

ntkzwane avatar Sep 13 '20 14:09 ntkzwane

Make sure is the same file in the Android and iOS project and check for versions and specific configurations.

I'm not sure I understand this 🙈. Which file in both android and ios projects? And check versions of what? And which specific configuration.

  • Check for the general and specific configurations in this link

  • The file is capacitor.config.json, there are 3 files, one for android, one for iOS and one for your web project.

  • Check the versions of your capacitor/core, capacitor/ios and capacitor-firebase-auth dependencies, i'm using: "@capacitor/core": "^2.4.1", "@capacitor/ios": "2.0.0-beta.1", "capacitor-firebase-auth": "^2.3.2",

  • Finally, dont forget to use the command npx cap sync to sync your plugins with your native projects

  • Here is an example of my capacitor.config.json file:

{
  "appId": "my.app.id",
  "appName": "AppName",
  "bundledWebRuntime": false,
  "npmClient": "npm",
  "webDir": "www",
  "plugins": {
    "CapacitorFirebaseAuth": {
      "providers": ["google.com", "twitter.com", "facebook.com"],
      "languageCode": "en",
      "nativeAuth": true,
      "permissions": {
        "google": ["profile"]
      }
    }
  }
}

SupineDread avatar Sep 13 '20 19:09 SupineDread

Make sure is the same file in the Android and iOS project and check for versions and specific configurations.

I'm not sure I understand this 🙈. Which file in both android and ios projects? And check versions of what? And which specific configuration.

  • Check for the general and specific configurations in this link
  • The file is capacitor.config.json, there are 3 files, one for android, one for iOS and one for your web project.
  • Check the versions of your capacitor/core, capacitor/ios and capacitor-firebase-auth dependencies, i'm using: "@capacitor/core": "^2.4.1", "@capacitor/ios": "2.0.0-beta.1", "capacitor-firebase-auth": "^2.3.2",
  • Finally, dont forget to use the command npx cap sync to sync your plugins with your native projects
  • Here is an example of my capacitor.config.json file:
{
  "appId": "my.app.id",
  "appName": "AppName",
  "bundledWebRuntime": false,
  "npmClient": "npm",
  "webDir": "www",
  "plugins": {
    "CapacitorFirebaseAuth": {
      "providers": ["google.com", "twitter.com", "facebook.com"],
      "languageCode": "en",
      "nativeAuth": true,
      "permissions": {
        "google": ["profile"]
      }
    }
  }
}

After adding some debug logs in the CapConfig.java, I finally realised that the structure of my capacitor.config.json file was wrong, I had the following

"plugins": {
    ...
    "plugins": {
      "CapacitorFirebaseAuth": {
       ...
    }
}

Apologies for the run-around, everything's working as expected for me.

just one note thought, I don't have 3 capacitor.config.json files (i.e I don't have one in the ios and android project), I have a single one at the root of my project and it's all working fine

ntkzwane avatar Sep 23 '20 07:09 ntkzwane