简体   繁体   English

没有适用于ionic3 ios项目的与ionic-native兼容的cordova插件

[英]No cordova plugin working with ionic-native for ionic3 ios project

Current behavior: None of plugins can be called from .ts files for all plugins, If you call plugin it says Ionic Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed. 当前行为:无法从所有插件的.ts文件中调用任何插件,如果调用该插件时显示Ionic Native:尝试调用StatusBar.styleDefault,但未安装StatusBar插件。

Expected behavior: Plugins should work like mentioned at https://ionicframework.com/docs/v3/native/ 预期的行为:插件应如https://ionicframework.com/docs/v3/native/所述正常工作

Steps to reproduce: 重现步骤:

No cordova plugin working with ionic-native for ionic3 ios project use package.json as below 没有适用于ionic3 ios的ionic-native的cordova插件使用package.json如下

{
  "name": "HelloWorld",
  "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": "^7.2.6",
    "@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/core": "^4.20.0",
    "@ionic-native/device": "^4.20.0",
    "@ionic-native/file": "^4.20.0",
    "@ionic-native/file-chooser": "^4.20.0",
    "@ionic-native/file-opener": "^4.20.0",
    "@ionic-native/file-path": "^4.20.0",
    "@ionic-native/file-transfer": "^4.20.0",
    "@ionic-native/http": "^4.20.0",
    "@ionic-native/network": "^4.20.0",
    "@ionic-native/splash-screen": "^4.20.0",
    "@ionic-native/sqlite": "^4.20.0",
    "@ionic-native/status-bar": "^4.20.0",
    "@ionic/storage": "2.2.0",
    "cordova-android": "7.1.4",
    "cordova-ios": "4.5.5",
    "cordova-plugin-advanced-http": "2.0.4",
    "cordova-plugin-device": "2.0.2",
    "cordova-plugin-file": "6.0.1",
    "cordova-plugin-file-opener2": "2.2.0",
    "cordova-plugin-file-transfer": "1.7.1",
    "cordova-plugin-filechooser": "1.2.0",
    "cordova-plugin-filepath": "1.5.1",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.2",
    "cordova-plugin-network-information": "2.0.1",
    "cordova-plugin-splashscreen": "5.0.2",
    "cordova-plugin-statusbar": "2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "3.1.0",
    "ionic-angular": "3.9.3",
    "ionicons": "3.0.0",
    "moment": "^2.24.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.29"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.2.2",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-advanced-http": {},
      "cordova-plugin-device": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-opener2": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-filechooser": {},
      "cordova-plugin-filepath": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  }
}

Related code: 相关代码:

Other information: 其他信息:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below): 离子信息:(从终端/ cmd提示符运行ionic info ,并在下面粘贴输出):



Ionic:

   ionic (Ionic CLI)  : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 11 other plugins)

System:

   ios-deploy : 1.9.4
   NodeJS     : v10.15.0 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Run ionic cordova platform remove ios then ionic cordova platform add ios . 运行ionic cordova platform remove ios然后ionic cordova platform add ios It seems your plugins are in an inconsistent state and removing and adding the platform should resolve that. 看来您的插件处于不一致状态,删除并添加平台应该可以解决该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM