首页 > 解决方案 > 无法在 ionic 3 项目的模块中导入 google plus 插件

问题描述

我正在Hybrid使用ionic-3. 我在 app.module.ts 和 page.ts 中导入 google plus 插件时遇到了麻烦。我已经从下面的命令成功安装了 google plus 插件,但我第一次遇到这个问题。

$ ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid

$ npm install --save @ionic-native/google-plus

我的导入错误在下图中

应用模块.ts

在此处输入图像描述

页面.ts

在此处输入图像描述

离子信息

cli 包:(C:\Users\sandip\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

全局包:

cordova (Cordova CLI) : 6.4.0

本地包:

@ionic/app-scripts : 3.2.1
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

系统:

Node : v8.1.4
npm  : 6.5.0
OS   : Windows 8

环境变量:

ANDROID_HOME : E:\newsdk\newsdk\tools;E:\newsdk\newsdk\platform-tools;E:\newsdk\newsdk\build-tools

杂项:

backend : pro

我希望这些信息足以理解我的问题。

标签: angularcordovaionic-frameworkionic3google-plus

解决方案


尝试将其导入您正在工作的模块中:

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

@ngModule({
   ...
   providers: [
      ...
      GooglePlus
    ]
})

推荐阅读