ionic 2 сборка android cryptojs

#android #cordova #ionic2 #cryptojs

#Android #кордова #ionic2 #cryptojs

Вопрос:

Я новичок в Ionic2. Я начал разработку в браузере, у меня было много проблем с внедрением модуля «crypto-js» и его использованием, но, наконец, я его получил.

Теперь я установил платформу Android в проекте, и теперь я получаю эту ошибку во время сборки:

 [09:20:04]  ionic-app-scripts 0.0.30
[09:20:04]  build prod started ...
[09:20:04]  clean started ...
[09:20:04]  clean finished in 26 ms
[09:20:04]  copy started ...
[09:20:04]  ngc started ...
[09:20:04]  lint started ...
[09:20:04]  copy finished in 226 ms
[09:20:05]  lint finished in 1.14 s
[09:20:23]  ngc: Error: Error at C:/cygwin/home/SEDI/mobile/ionic2/papp/.tmp/app/plrt-connections/plrt-connections.ts:6:27: Cannot find module 'crypto-js'.
Error at C:/cygwin/home/SEDI/mobile/ionic2/papp/.tmp/app/plrt-connections/plrt-connections.ts:19:9: Return type of public method from exported class has or is using name 'Observable' from external module "C:/cygwin/home/SEDI/mobile/ionic2/papp/node_modules/rxjs/Observable" but cannot be named.
    at check (C:cygwinhomeSEDImobileionic2pappnode_modules@angulartsc-wrappedsrctsc.js:31:15)
    at Tsc.typeCheck (C:cygwinhomeSEDImobileionic2pappnode_modules@angulartsc-wrappedsrctsc.js:86:9)
    at C:cygwinhomeSEDImobileionic2pappnode_modules@angulartsc-wrappedsrcmain.js:33:23
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Function.Module.runMain (module.js:449:11)
    at startup (node.js:146:18)
    at node.js:404:3


[09:20:23]  ngc: Compilation failed


[09:20:23]  ngc failed:  NGC encountered an error
[09:20:23]  Error: NGC encountered an error
    at ChildProcess.<anonymous> (C:cygwinhomeSEDImobileionic2pappnode_modules@ionicapp-scriptsdistngc.js:62:24)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at ChildProcess.cp.emit (C:cygwinhomeSEDImobileionic2pappnode_modulescross-spawnlibenoent.js:40:29)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:475:12)
Error running ionic app script "build": Error: NGC encountered an error
  

Эта ошибка появляется только после запуска «ionic build android» или «ionic run android», но с «ionic serve» все в порядке. Я погуглил, но я не нашел никого с этой проблемой с crypto-js или другим модулем.

packages.json:

 {
  "name": "papp",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "dependencies": {
    "@ionic/storage": "^1.0.3",
    "crypto-js": "^3.1.6",
    "ionic-angular": "^2.0.0-rc.0",
    "ionic-native": "^2.0.3",
    "ionicons": "^3.0.0",
    "ng2-translate": "^3.1.0",
    "@ionic/app-scripts": "latest",
    "typescript": "^2.0.3"
  },
  "devDependencies": {

  },
  "description": "papp: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": []
}
  

Не стесняйтесь спрашивать меня о дополнительной информации и заранее благодарите.