0

I'm trying to Integrate GooglePlus signin to Ionic w/ Angular app.

error:

ERROR Error: Uncaught (in promise): Error: Invalid provider for the NgModule 'UsersModule' - only instances of Provider and Type are allowed, got: [Keyboard, ?[object Object]?]

users.module.ts

...
import { GooglePlus } from '@ionic-native/google-plus';

@NgModule({
  declarations: [
    ...
  ],
  entryComponents: [
    ...
  ],
  imports: [
    ...
  ],
  exports: [
    ...
  ],
  providers: [
    ...,
    GooglePlus
  ]
})
export class UsersModule { }

1 Answer 1

2

You need to change your import path to:

import { GooglePlus } from '@ionic-native/google-plus/ngx';

You may see a build error:

An unhandled exception occurred: The target entry-point "@ionic-native/google-plus" has missing dependencies:
 - @ionic-native/core

Just install the @ionic-native/core dependency and you should be good to go.

npm install @ionic-native/core

Last thought, If you have trouble with that Cordova plugin, another option is @codetrix-studio/capacitor-google-auth. Simon Grimm has a great blog, How to add Capacitor Google Sign In to your Ionic App, which describes all the steps necessary to get Google auth working.

1
  • alright, that's a good alternative, thanks
    – Evan
    May 17, 2021 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.