【问题标题】:Uncaught Error: Can't resolve all parameters for GoogleAuth: (?)未捕获的错误:无法解析 GoogleAuth 的所有参数:(?)
【发布时间】:2017-05-17 15:07:03
【问题描述】:

我在控制台编译后运行时遇到这个问题。

未捕获的错误:无法解析 GoogleAuth 的所有参数:(?)

这就是我在名为 googleServices.ts 的服务中所做的事情

// Core
import { Injectable } from '@angular/core';
import { GoogleAuth, User } from '@ionic/cloud-angular';
import { LoadingController, Events } from 'ionic-angular';

// Plugins
import { Firebase } from '@ionic-native/firebase';


@Injectable()
export class GoogleAuthServices {
  userImg;
  profile_picture;
  fullName;
  pushToken;
  status;

  constructor(
    public googleAuth: GoogleAuth, 
    public user: User, 
    public loadingCtrl: LoadingController, 
    public events: Events
  ) {}

  signIn(): Promise<any>{
    let loading = this.loadingCtrl.create({
      content: 'Please wait...'
    });

    return this.googleAuth.login().then((userRes)=>{
        loading.present();
        alert(JSON.stringify(userRes));
        loading.dismiss();
    });
  }
}

我大量寻找解决方案。

请帮忙

【问题讨论】:

    标签: ionic-framework ionic2 google-authentication


    【解决方案1】:

    只需将其添加到 app.module.ts 文件中的提供程序部分,一切正常。

    【讨论】:

      【解决方案2】:

      可能是@ionic/storage 1.1.7 中的一个错误。为了解决这个问题,打开你的 package.json 并将 "@ionic/storage": "^1.1.7" 替换为 "@ionic/storage": "1.1.6"。 也不要忘记运行 npm install。这可能会解决您的问题。

      【讨论】:

      猜你喜欢
      • 2018-08-22
      • 2018-12-18
      • 2018-09-21
      • 2023-03-16
      • 2019-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多