ionic3下Android7.1.1平台安装4.0.2的Jmessage插件,提示plugin_not_installed

ionic
标签: #<Tag:0x00007fca74f0e2e0>

#1

我的环境:
Android7.1.1平台
Ionic 3
cordova 8.1.2

现在遇到的问题是:
一直提示jmessage plugin is not installed,但是这个插件我已经按照git上的要求装过了,版本是4.0.2!而且运行ionic cordova plugin list也提示插件存在,现在就是不知道遇到什么问题,求解答…

[app-scripts] [15:41:34] console.warn: Ionic Native: tried calling JMessagePlugin.getConversations, but the JMessagePlugin plugin is
[app-scripts] not installed.
[app-scripts] [15:41:34] console.warn: Install the JMessagePlugin plugin: ‘ionic cordova plugin add jmessage-phonegap-plugin’


#2

看下package.json有没有插件信息


#3
{
  "name": "chat",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/camera": "^4.20.0",
    "@ionic-native/core": "~4.18.0",
    "@ionic-native/file": "^4.20.0",
    "@ionic-native/media": "^4.20.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic/storage": "2.2.0",
    "@jiguang-ionic/jmessage": "^2.0.0",
    "cordova-android": "7.1.1",
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-file": "6.0.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.3.2",
    "cordova-plugin-jcore": "1.2.7",
    "cordova-plugin-media": "5.0.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "jmessage-phonegap-plugin": "git+https://github.com/jpush/jmessage-phonegap-plugin.git",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-file": {},
      "cordova-plugin-media": {},
      "jmessage-phonegap-plugin": {
        "APP_KEY": "d82e3617a88f767dba8c541a",
        "CHANNEL": "developer-default"
      }
    },
    "platforms": [
      "android"
    ]
  }
}

#4

卸载重装试一下


#5

谢谢,我已经重装了不下10次了,git上的三种安装方式都试了,不行。
而且android包里有这个插件,所以我估计不是安装的问题吧,这个需要安装jcore这个插件吗?


#6

JCore 是自动安装,你上面内容显示已经安装了

研发让你先build一下项目呢,或者重新建个demo项目试一下,环境问题比较难说是哪里导致的


#7

虽然提示plugin_is_not_installed,但是我依然可以直接登录,其他的操作也可以正常进行,这是为什么?
现在App每次打开都Alert一次 plugin_is_not_install,会不会是Ionic的运行方式问题?


#8

还是有问题,我先build,然后直接安装,系统就显示SDK未初始化,不过我已经初始化了,最不可思议的是我直接运行ionic cordova run android -l -c,这时候除了弹出plugin is not installed,其他的没啥问题!两个问题的代码是一致的


#9

这有点奇怪,插件的开发这边看了下没有遇到过此类情况,不太清楚原因。

显示未初始化的那个,看看是不是在初始化完成之前调了其他的 API 导致的


#10
  this.jmessage.init({ isOpenMessageRoaming: true });

  this.jmessage.setDebugMode({ enable: true })

就这两行代码