Uncaught Error: Can't resolve all parameters for GoogleAuth: (?)
Uncaught Error: Can't resolve all parameters for GoogleAuth: (?)
我在控制台中编译后在 运行 上遇到了这个问题。
Uncaught Error: Can't resolve all parameters for 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/storage 1.1.7 中的错误。要解决这个问题,请打开您的 package.json 并将 "@ionic/storage": "^1.1.7" 替换为 "@ionic/storage": "1.1.6"。
也不要忘记 运行 npm install。这可能会解决您的问题。
只需将其添加到 app.module.ts 文件中的提供程序部分,一切正常。
我在控制台中编译后在 运行 上遇到了这个问题。
Uncaught Error: Can't resolve all parameters for 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/storage 1.1.7 中的错误。要解决这个问题,请打开您的 package.json 并将 "@ionic/storage": "^1.1.7" 替换为 "@ionic/storage": "1.1.6"。 也不要忘记 运行 npm install。这可能会解决您的问题。
只需将其添加到 app.module.ts 文件中的提供程序部分,一切正常。